Tuesday, February 21, 2012

Volume with snapshots on hz.cs.berkeley.edu

I just lost maybe 4 hours work by typing "rm **/*>o" instead of "rm **/*.o" (argh...), so I set up a btrfs volume on our machine hz that will snapshot itself every hour. So, move your work into /snappervol/your-username if you want that feature. The backups are stored in /snappervol/.snapshots/SNAPSHOT-NUMBER/snapshot. I made a convenience script to get the latest backed up version of a file,

snapper-latest FILENAME

The snapshots seem pretty space-efficient (i.e. taking a snapshot doesn't waste any space if things don't change).