As mentioned in the last post, I was looking into creating a simple solution for incremental backups. As I start hosting more websites, I’ll need to ensure reliable backups are available at various time frequencies. Some hosted sites are so infrequently updated, a monthly backup is all that’s needed. Others, would benefit from hourly point-in-time snapshots in addition to the less frequent backups. Rsync does a magnificent job of performing incremental archives. What’s needed is to add snapshot type functionality on top if it.
Enter: Mr. Freeze.
Mr. Freeze is a Python utility I wrote which allows for snapshots to be generated for one, or more directories on the local machine. For each directory, you can configure various snapshot settings such as the time schedule (hourly, daily, weekly, monthly) and the number of snapshots to retain for each timeframe.
The beauty of using snapshots is that you aren’t actually creating copies of files, thus eating up precious server disk space. Instead, Mr. Freeze (via rsync) uses hard links. If files haven’t changed, only extra inodes are chewed up. We’ve got plenty of those to go around.
In addition to performing snapshots on directories, Mr. Freeze will also store backups of your MySQL databases within the snapshots. At the completion of a snapshot cycle, Mr. Freeze will generate a summary along with log files, and email them to you.
The initial version is available on Github.
Testing is EXTREMELY LIMITED (aka I’ve only done some basic testing on my local boxes) so I suggest waiting until the first release before putting it into any mission critical stuff.