Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
-
The problem statement, all variables and given/known data:
Attempting to make a auto restore script i have one made for backing up cron and installed programs just need to do it back the other way. -
The attempts at a solution (include all code and scripts):
#!/bin/bash
echo "This script will atempt to restore a server back to a previos state"\
echo "This is written to be excuted from server 20"
echo -n "Please enter the server number";
read $server
echo -n "Please enter the user name";
read $user
echo -n "Please enter the date you wish to restore to in this format 2012-04-13-Friday";
read $date
echo -n "location of installed apps ie /storage/backups/$date/$server/$user/backup/installed/installed-software";
read $locationinstalled
echo -n "Location of cronjobs file ie /storage/backups/$date/$server/$user/backup/cron/cronjobs";
read $locationcron
rsync -av -e ssh $user@$server.exmaple.net:/$locationinstalled/ /home/$user/
rsync -av -e ssh $user@$server.example.net:/$locationcron/ /home/$user/
ssh $user@$server.example.net
crontab -l < cronjobs
cat installed-software | sudo dpkg --set-selections && sudo apt-get dselect-upgrade
echo "WE HAVE DONE IT YAY!"
#End script