Tags
webcam vindaloo vim version vegan unix unicef trojan todo tmux thinkpad textmate testing tagging syntax svn sugar subversion stubbing sphinx spam spaces solaris sitemap site sinatra shoulda sheet set security search schema_info SchemaInfo ruby rinari restaurant relationships refresh rdiff-backup ramaze railsconf08 railsconf07 rails protools production power placeboeffect pink floyd PIC perl overheat outbreak osx os x NYHS NYC nginx netbeans nested nanophotonics mysql music MPEG-4 mongrel model migration microvolunteer macbook mac logrotate logic log linux less leopard keynote JAX javascript java jacksonville iterm2 iterm imunizator highlighting hanna Handbrake haml hacks google geocoding genghistron gem gaming gabrielle's funny functional fun friends food fixesThe Decider said over 4 years ago permalink Comment? (0)
Tagged: unix backup rdiff-backup
rdiff-backup
rdiff-backup is a wonderful program. There I said it! I’m in love with a backup program. As chief cook and bottle washer I must backup our servers (off-site) and systems in the office and there is no better way that I’ve found than rdiff-backup,
First off there is no restore command or shall I say not a conventional one. Just use cp . rdiff-backup, RDB, creates a mirror of the machine you are backing up so just go to that directory and copy the files or drag and drop using a gui. The files in the mirror are from you last backup. Of course RDB stores incremental reverse diffs so if you need to see that file that’s gone missing it’s pretty easy to do that but you’ll need to use RDB’s command line interface.
Here’s my backup scheme…Most of our backups are done using a 3rd party user called backthatassup . ‘backthat…’ stores his (her?) RDB commands in a crontab that looks like this:
00 11 * * * sudo rdiff-backup -v6 --print-statistics \
--exclude '/mnt/home/home/**/.Trash/' \
--exclude '/mnt/home/home/**/.google/' \
--exclude '/mnt/home/home/**/.cache/' \
--exclude '**.log' \
/mnt/home/home \
/media/disk/backups/jokerman/home
# cleanup backups each month to only hold 2 months worth of data
@monthly sudo rdiff-backup -v6 --print-statistics \
--remove-older-than 2M \
--force \
/media/disk/backups/jokerman/home
The first command runs daily at 11 am and backups up the directory:
/mnt/home/homeThe backup is stored at:
/media/disk/backups/jokerman/homeThe options:
- -v6 – verbosity level
- —print-statistics – gives a summary at the end of the backup.
- —exclude – the directories and files I don’t want to backup.
The second command runs monthly and removes all files older than 2 months old.
Restoring files that are older than the current mirror is pretty easy. You can specify that you want a file from a specific date or relative from now. To restore the file, file.to.recover from 10 days ago try:
rdiff-backup -r 10D /my/backup/location/file.to.recover \ /and/put/it/here/RDB runs on most unix, mac os x and window’s platforms. I personally use it to backup all 3 of those platforms on to my ubuntu machine which has a couple of external harddrives for storage. When backing up machines on the internets all data is transferred using ssh. Read Secure. RDB uses the rsync library so only changed versions of files are sent. This is handy when backing-up large log files that may be gigabytes in length but only increase by tens of megabytes each day. Only the additions are sent NOT the whole file.