Backups with CRIBBS
I’ve been using ChronoSync for years. At one time it was all I used for backups. It was somewhat flexible, somewhat easy to use, always reliable… Then Time Machine came along*.
Since then I’ve beefed up my data retention and redundancy policies to include several buckup routines with multiple applications across multiple media. My current backup regime consists of:
- several daily automated ChronoSync backups of critical directories to various portable USB drives and LAN storage units,
- Time Machine of the user directory to an internal drive,
- DropBox storage of critical directories,
- MobileMe for preferences and settings,
- several manual backup operations to my Linux server
Seems pretty comprehensive, somewhat painless and hands-off, but where the real bottle-neck occurs is when ChronoSync and Time Machine start backing up at the same time. ChronoSync is a pig and tends to just buckle as soon as Time Machine winds up. The two apps seem to compete for the same cycles and neither one will free up any resources until I’m forced to stop both processes. Growing very tired of this battle of the two backup schemes I decided to write my own backup script.
I’ve come to like Time Machine’s snapshot-like, incremental backups, and I’ve become weary of just backing up segments of what I value. So first and foremost I wanted my script to backup everything.
Second, it has to be fast and efficient. The lighter it is the more often I can run it. The more often I run it the the better my chances are of having the latest greatest backups.
Third, it needs to backup to a server. Time Machine does a great job of backing up to local hardware so there is no need to replicate that.
Lastly, it needs to run automatically.
To achieve these goals I decided early on what technologies I was going to use (it was a no-brainer actually).
- When you think of any communication between a computer and a remote server, shell scripting is the obvious choice. Since most *nix systems come loaded with Bash then…
- rsync, an awesomely powerful command line program that excels at remote synchronizations with minimal data transfer will do the bulk of the work.
- SSH is going to be the pipe that gets me from here to there.
- cron is going to allow me to schedule my backups .
The Script — CRIBBS
I spent a few days perusing the web for solutions that could give me a start. I ended up drawing off a number of key sources** but in the end had put together the best script for me. It’s not terribly original but it did take me a solid day to get things just right. There is more I’d like to do to it yet but this will do for now.
No point including it here since it’s likely to change and improve over time. But you can see it in all it’s glory over on Code Collector… ladies and gentlemen, I give you CRIBBS — Cron Rsync Incremental Backup Bash Script!
** Here are some of the main sites I used for inspiration: