Tuesday, January 25, 2005

Work Backups

So I wrote two backup strategies at work lately. Both seem to work rather fine, but I can see that unless I document them somehow they are going to overlap in my brain and that would be bad.

The first one is the the snapshot.rb/deepfreeze.pl/rsync strategy. In this one, we take and do a synchronization to a target disk. Then each day we rotate this snapshot and any other snapshots on disk to older directory names. So disk.2 would be moved to disk.3 and disk.4 to disk.5. Depending on how many snapshots are in the disk the last one is removed each time we rotate. This is where deepfreeze.pl comes in. He basically goes in and checks to see what is different from this snapshot and the latest snapshot and then archives those differences in a tarball [archive file] on yet another disk. This means you get all the files that have been changed since the final snapshot was taken. This is cool and lets a person go back to any day as long as you have snapshots and tarballs and get file *at that day*. [Mental note: Check deepfreeze and see how it's diffing]

The second strategy is to take a timestamp file and find all the files on a drive that are newer than that file. Then tar them all up. Simple, eh? The other neat thing is that you can change the timestamp so that it says "Back up everything since 1969" for example and get a full backup. It's really smooth and makes backing up stuff on an odd schedule really easy. Just touch the file once a week to be a week old and it'll do a weekly backup. Touch it once a month and get one, two, or even three month backups depending on the date you specify.

Yeah it's cool.

No comments: