Thoughts of just about anything
Moving from backup2l to rsnapshot for a better backup
For a while now I’ve been using backup2l for my automated backups, but there where a few things I didn’t like about it. First the fact that all the backups where compressed, which is fine when you are trying to save space but trying to restore something can be a pain. in backup2l’s defense it does have a locate/restore option to quickly search and restore files, but I find that it takes time to search and if your file is a common name you’ll get multiple hits unless you narrow down your search. Another thing that bugged me was that I really never did get the configuration of levels and max per levels. I did play around with it and got something that worked for me but didn’t really understand it. So I started looking for an alternative.
I have a Mac at home with OS X and one of the things that interested me was a time machine kind of solution. I did find a very good article by Mike Rubel on using rsync to do automated snapshot backups, basically the time machine style I was looking for and fortunately I found an implementation in the Ubuntu repository called rsnapshot. This script basically creates a mirror image of the directories you want to backup using hard links. There by saving disk space on files that have not been modified. It can be configured to do backups at different intervals, such as hourly, daily, weekly, etc… Another plus is that the backup is a mirror image, meaning if I want to restore a file I can just cd into the backup directory and copy it over to the location I want to restore it to. Configuration is fairly straight forward and quickly to setup.
rsnapshot does include a diff utility to check the differences between backups (rsnapshot-diff), my only problem with it is that the way it reports the results can be somewhat confusing and hard to follow. For example if a file is added a line with the file name pre-pended with a plus sign appears and if a file is deleted a minus sign is displayed instead. The confusion come in when a file is modified, instead of using a third symbol to denote this the file shows up twice, once with a minus and later with a plus to denote that the file was removed a the new one replaced it.
To deal with the rsnapshot-diff report a wrote a quick python script to convert the output to a hierarchical style report using plus and minus to denote new files and deleted files but also resolving modified files and giving them an exclamation mark instead to make it more clear that the file was modified. I am also a big fan of License GNU GPL v3, rs2tree, rs2tree.vim
| Print article | This entry was posted by Juan Frias on June 21, 2009 at 7:24 pm, and is filed under Linux, Ubuntu, Vim Editor. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |