rsnapshot flag for usb drive

rsnapshot is a great tool that I use for all my backup stuff, its really easy and seems pretty robust (or rather, I haven’t broken it yet!). When I set it up most recently, I discovered that it has a very useful flag, no_create_root. The problem I often have is that since I back up to removable media, if the disk isn’t mounted, rsnapshot will back up to the local drive instead, in the mount point – and then I’ll promptly run out of space. Stopping rsnapshot from creating directories means no writing rubbish into your mount point, and this setting is designed specifically for this issue with removable media.

This setting does have a gotcha, however. It does the check for whether the directory exists before it calls the script named in cmd_preexec – so if you were hoping to mount your drive in the pre-exec script, you can’t! I was very confused why my rsnapshot configuration didn’t work to start with. My workaround is to run a separate mount script before calling rsnapshot in a cron job, not ideal but it does work for me.

4 thoughts on “rsnapshot flag for usb drive

  1. Lorna, I hadn’t heard of rsnapshot before. I currently use rdiff-backup instead. Are you familiar with rdiff-backup? Do you have any thoughts about the two?

    rsnapshot seems awfully nice in that every file is just a ‘copy-able’ file to do a ‘restore’. Which makes it good not only for backups, but also just for ‘extra storage’ (even if you have to traverse the odd hourly.0 type directories.

    Whereas rdiff-backup saves more space, but keeping diff files (and in some cases reverse diffs) to know the differences that existed in old versions.

  2. Eli: I am not familiar with rdiff-backup, and I must say I like that rsnapshot gives me whole snapshots of files at each point in time – I can just grab the file I need and copy into place, but the generations don’t take up much space.

    LinuxJedi: I don’t usually keep the drive mounted, my backups are on here so really I’d like the disk in a fireproof safe underground but just settling for disconnected and therefore inaccessible suits me too.

  3. We had some fun and games with our house server recently, when one of its disks died horribly*. I’ve only just got around to sorting out the backups again now, which use an external USB hard drive and rsnapshot. I started by reading my earlier rsnapshot

Leave a Reply

Please use [code] and [/code] around any source code you wish to share.

This site uses Akismet to reduce spam. Learn how your comment data is processed.