#
rsync -avxrP --delete $FILESYSTEMS backup-server:backups/$HOSTNAME
Some caveats if you want to fully automate this...
- remove -vP (verbose w/ progress)
- --delete is NECESSARY to make sure deleted files get deleted from the
backup
- FILESYSTEMS should be any local filesystems you want backed up (-x
won't cross filesystems, makes backing up in NFS environment easier)
- obviously this doesn't preclude a bad guy checking out
backup-server:backups/otherhostname (use ssh keys, and invoke cmd="cd
backups/hostname; rsync with whatever daemon options" will limit that)
- on backup-server, rotate the backup every 12 hours or whatever.
- rsync -ar --delete store/hostname.2 store/hostname.3
- rsync -ar --delete store/hostname.1 store/hostname.2
- rsync -ar --delete backups/hostname store/hostname.1
# that could be better optimized, but you get the idea
I've used this rsync system to successfully maintain up to date backups w/
great ease, AND restore very quickly... use a LinuxCare Bootable Business
Card to get the target fdisked and ready, then mount the filesystems as
you desire, and rsync -avrP backup-server:backups/hostname /target. I got
a 700mb server back online in under 20 minutes from powerup to server
serving requests (the rsync itself is 3 to 5 minutes). Making sure you
do (cd /target; lilo -r . -C etc/lilo.conf)) is the only tricky part.