Hi All, I have been using rsync to backup to a central server with a 7 day incremental script on 2 Redhat boxen. #!/bin/sh PATH=/usr/local/bin:/usr/bin:/bin DAY=`date +%A` export PATH DAY [ -d /root/emptydir ] || mkdir /root/emptydir rsync --rsh=/usr/bin/ssh --delete -a /root/emptydir/ CENTRAL_SERVER_IP:/backup2/BACKED_UP_SERVER_FQDN/$DAY rmdir /root/emptydir rsync --delete --stats --compress --recursive --times --perms --links --rsh=/usr/bin/ssh --exclude "tmp/" --exclude "dev/" --exclude "proc/" --exclude "backups/ " --delete-excluded --backup --backup-dir=/backup2/BACKED_UP_SERVER_FQDN/$DAY -a /* CENTRAL_SERVER_IP:/backup2/BACKED_UP_SERVER_FQDN/current && echo "Daily backup ran on `date`" >> /var/log/backup.log # End Script This has been working fine and I've even been able to restore files using scp from time to time. now I'm faced with a bare metal recovery cause of a botched upgrade from Redhat 7.1 to 8.0 that failed half way through. This machine was still accessible via console and ssh (putty). I signed in via ssh and ran... # cd / # scp -r CENTRAL_SERVER_IP:/backup1/BACKED_UP_SERVER_FQDN/current/.* . This was running for a while and then i lost my connection and cant reconnect. I won't have console access till the morning but any advice would be greatly appreciated. Thanks ..:..:..:..:..:..:..:..:..:..:..:..:.. Mark E. Hanze IT Solutions Consultant 845-629-1048 www.hanzehome.com -------------- next part -------------- HTML attachment scrubbed and removed
> rsync --delete --stats --compress --recursive --times --perms --links > --rsh=/usr/bin/ssh --exclude "tmp/" --exclude "dev/" --exclude "proc/" > --exclude "backups/ " --delete-excluded --backup > --backup-dir=/backup2/BACKED_UP_SERVER_FQDN/$DAY -a /* > CENTRAL_SERVER_IP:/backup2/BACKED_UP_SERVER_FQDN/current && echo "Daily > backup ran on `date`" >> /var/log/backup.logNotice that if you have any dotfiles in / (that is, flies that begin with a "."), this will not copy them, but normally you wouldn't have dotfiles in / so it shouldn't matter. Might want to start using / instead of /* from now on though, just for good form.> This has been working fine and I've even been able to restore files using > scp from time to time. now I'm faced with a bare metal recovery cause of a > botched upgrade from Redhat 7.1 to 8.0 that failed half way through. This > machine was still accessible via console and ssh (putty). I signed in via > ssh and ran... > > # cd / > # scp -r CENTRAL_SERVER_IP:/backup1/BACKED_UP_SERVER_FQDN/current/.* . > > This was running for a while and then i lost my connection and cant > reconnect. I won't have console access till the morning but any advice > would be greatly appreciated.Don't you mean: scp -rp CENTRAL_SERVER_IP:/backup1/BACKED_UP_SERVER_FQDN/current/. . ? The command you list above won't copy anything, since there are no dotfiles in the root directory. Also, you have backup2 in the rsync command and backup1 in the scp command. Maybe that was just a typo though... One final thought. Sometimes scp has issues with symlinks (as in, copying the target instead of the link). Might want to use: cd / rsync -av CENTRAL_SERVER_IP:/backup1/BACKED_UP_SERVER_FQDN/current/ . Mike
To Mike and the Rsync community, This is by far the greatest utility I have ever used for backing up an entire system. My Redhat server got botched during an upgrade. I reformatted my partitions and installed a minimal system. Rsync'ed the entire / directory back and the server came back to life. databases, websites, hardware configs, everything! I'm back in business. As a Linux newbie, not a luser, I really appreciate the response I received from Mike and others. As the days pass and my skills refine, I will offer back as much support as I can. I guess you can say another BillyBorg saved :) Thanks Again! Mark> > > rsync --delete --stats --compress --recursive --times --perms--links> > > --rsh=/usr/bin/ssh --exclude "tmp/" --exclude "dev/" --exclude"proc/"> > > --exclude "backups/ " --delete-excluded --backup > > > --backup-dir=/backup2/BACKED_UP_SERVER_FQDN/$DAY -a /* > > > CENTRAL_SERVER_IP:/backup2/BACKED_UP_SERVER_FQDN/current && echo"Daily> > > backup ran on `date`" >> /var/log/backup.log > > > > Notice that if you have any dotfiles in / (that is, flies that beginwith> > a "."), this will not copy them, but normally you wouldn't havedotfiles> > in / so it shouldn't matter. Might want to start using / instead of/*> > from now on though, just for good form. > > Thanks fot the tip :) > > > > > > > This has been working fine and I've even been able to restore filesusing> > > scp from time to time. now I'm faced with a bare metal recovery > cause of a > > > botched upgrade from Redhat 7.1 to 8.0 that failed half way through.This> > > machine was still accessible via console and ssh (putty). I signedin via> > > ssh and ran... > > > > > > # cd / > > > # scp -r CENTRAL_SERVER_IP:/backup1/BACKED_UP_SERVER_FQDN/current/.*.> > > > > > This was running for a while and then i lost my connection and cant > > > reconnect. I won't have console access till the morning but anyadvice> > > would be greatly appreciated. > > > > Don't you mean: > > > > scp -rp CENTRAL_SERVER_IP:/backup1/BACKED_UP_SERVER_FQDN/current/. . > > > > ? > > > > The command you list above won't copy anything, since there are no > > dotfiles in the root directory. Also, you have backup2 in the rsync > > command and backup1 in the scp command. > > > > Maybe that was just a typo though... > > As never having restored anything more that a few files at a time as > the Linux newbie that I am, I'm sure i was off. Thanks for the tipagain :)> Typo it was. Should have been backup2 in the scp command. > > > > > > One final thought. Sometimes scp has issues with symlinks (as in,copying> > the target instead of the link). Might want to use: > > > > cd / > > rsync -av CENTRAL_SERVER_IP:/backup1/BACKED_UP_SERVER_FQDN/current/ . > > I will try this first thing in the morning when I have console access. > > Just one more thing; Based on the script I use, am I SOL or with a > little elbow greese in the morning get my server back? > > Thank you for your time and advice. I really appreciate it!!!!! > > Mark > > > > > Mike > > > > -- > > To unsubscribe or change options: http://lists.samba. > > org/mailman/listinfo/rsync > > Before posting, read:http://www.tuxedo.org/~esr/faqs/smart-questions.html -------------- next part -------------- HTML attachment scrubbed and removed
Reasonably Related Threads
- Backup of the 5 last revisions of files
- DO NOT REPLY [Bug 7809] New: I/O errors other than IOERR_GENERAL should not suppress deletion
- Upgrading system from non-RAID to RAID1
- CentOS6: missing kernel module?
- Ensuring that rsync doesn't try to write to an unmounted drive