Backup and recovery
Backups
Data Recovery
Undelete ext3 Files
PhotoRec


rsync command for backing up a directory
Below is a cronjob line used to backup the /etc directory to the backup server. It will delete any files on the backup server which are not on the server being backed up. Additionally, be aware the numeric-ids switch is being used.

18 4 22 * * /usr/bin/rsync -avur --delete --numeric-ids -e ssh root@sabre:/etc /hold/backup/sabre/week4/


rsync crypto command for backing up a directory
Below is a cronjob line used to backup the /etc directory to another drive on the same server. It will encrypt the filenames as well as the data being backed up.
30 2 * * * /usr/bin/rsyncrypto --delete-keys --ne-nesting=2 -cr /etc/ /drive2/backup/etc/ /drive2/crypto/keys /drive2/crypto/backup.crt


Misc Notes
Backups:
Never attempt to backup the entire drive, use exclude lists
Disaster:
Stop everything and if possible, image the damaged drive using dd
Cheap data recovery services start in the $300-$500 range
PhotoRec understands 180 different file types