Bash Script Restore help

 
Thread Tools Search this Thread
Homework and Emergencies Homework & Coursework Questions Bash Script Restore help
# 1  
Old 04-19-2012
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.






3. The attempts at a solution (include all code and scripts):

Code:
#!/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

# 2  
Old 04-19-2012
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.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to block first bash script until second bash script script launches web server/site?

I'm new to utilities like socat and netcat and I'm not clear if they will do what I need. I have a "compileDeployStartWebServer.sh" script and a "StartBrowser.sh" script that are started by emacs/elisp at the same time in two different processes. I'm using Cygwin bash on Windows 10. My... (3 Replies)
Discussion started by: siegfried
3 Replies

2. Shell Programming and Scripting

Help Writing File Restore Script

Hi all, I have been tasked with creating a script that sends a file into a created "recycling" directory and another script that restores a "deleted" file. I have already created the removal script but am stuck on the restoring part. I need to restore the file to its original location by... (0 Replies)
Discussion started by: bashbeginner
0 Replies

3. Shell Programming and Scripting

Delete/Restore Script

Hi there is anyone able to show me two scripts for a delete and a restore command. Delete - move a file to a dustibin directory that i have created. check to see if that file exsits first in the dustbin if so delete the file before moving the new one. Restore - return the file to its... (1 Reply)
Discussion started by: arsenal1994
1 Replies

4. Shell Programming and Scripting

RecycleBin Script Restore

Hi there I am making a recycle bin script in linux that consists of three scripts delete, trash and restore. The problem is with my restore script, it is using a Paths text file to store file locations when it is deleted, so that if the user restores a file out of the trash bin (recyclebin) the... (8 Replies)
Discussion started by: zinn
8 Replies

5. Shell Programming and Scripting

RecycleBin Script Restore

this is complete.. (2 Replies)
Discussion started by: zinn
2 Replies

6. Shell Programming and Scripting

Help with rsync file restore script

Hello Friends, I am trying to create an rsync file restore script. I will post want I have below and explain the problem I am having. #!/bin/bash # # Partial Rsync File Restore Script # # clear echo # Shell loads into /raid0/data/backup/bin/ cd .. # I cd to the backup... (1 Reply)
Discussion started by: jdavis_33
1 Replies

7. AIX

mksysb restore - Wrong OS level for restore

Hi all, I am still working on my mksysb restore. My latest issue is during an alt_disk_install from tape I got the following error after all the data had been restored. 0505-143 alt_disk_install: Unable to match mksysb level 5.2.0 with any available boot images. Please correct this... (0 Replies)
Discussion started by: pobman
0 Replies

8. Shell Programming and Scripting

not showing restore information while run script

Hello, I have the following script to restore file and grep information. However, once it restore file, it showing a lot useless information and different to check which file have the statement "John price $200". Can I not show any information while running script. It only show..when found the... (1 Reply)
Discussion started by: happyv
1 Replies

9. Shell Programming and Scripting

Restore Script

Hope I have posted this in the correct forum. I'm trying to recover some Oracle files from tape to setup an offsite recovery system. These files are nightly backdumps tar to tape. I have recovered rootvg and vg01 from the weekends full backup, now to restore these nightly files I discovered I... (1 Reply)
Discussion started by: Chrisp
1 Replies
Login or Register to Ask a Question