Bash Script Restore help

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!

  1. 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.

  2. 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



Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum under special homework rules.

Please review the rules, which you agreed to when you registered, if you have not already done so.

More-than-likely, posting homework in the main forums has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.

If you did post homework in the main forums, please review the guidelines for posting homework and repost.

Thank You.

The UNIX and Linux Forums.