Saturday, February 21, 2009

Local snapshots

Recently I've started using rsnapshot, and have found it pretty useful. Rsnaphsot uses librsync to create snapshots of various directories.

On my systems I typically configure backups of:

backup /etc/ localhost/
backup /usr/local/ localhost/
backup /var/lib/rpm localhost/

Drop in cron entries into /etc/crontab:

# Backup filesystems 0 */4 * * * root /usr/bin/rsnapshot hourly 50 23 * * * root /usr/bin/rsnapshot daily 40 23 1,8,15,22 * * root /usr/bin/rsnapshot weekly 30 23 1 * * root /usr/bin/rsnapshot monthly

And get snapshots under /.snapshots

daily.0 daily.1 daily.2 daily.3 daily.4 daily.5 daily.6 hourly.0 hourly.1 hourly.2 hourly.3 hourly.4 hourly.5 monthly.0 weekly.0 weekly.1 weekly.2 weekly.3

It doesn't take up much space. If I wanted to I could store the snapshot remotely. And it's been helpful when I needed to remind myself what I did on some host that may have caused issues.