I am mounting my remote backup volume using a rsnapshot cmd_preexec script.

If the /mnt/backup directory doesn't exist when starting rsnapshot i get this error:

ERROR: /mnt/backup does not exist.  

If the directory exists and the preexec mounting fails, it does not stop rsnapshot resulting in the backup being backed up on the completely wrong server...

What should I do about this?

I know that I could use a wrapper-script, but I don't want to do this..


Oh well, looks like i DO have to use a wrapper script.

If anyone has a better idea, feel free to post.


I know that I could use a wrapper-script, but I don't want to do this..

So you know an easy solution exists. Why not use this?

Anyway, it's even documented. Set your snapshot_root to e.g. /mnt/remotefs/.snapshot where /mnt/remotefs is the mount point of your remote/loopback fs and also set no_create_root to 1. rsnapshot will now fail if it can't find it's snapshot root dir.

  • Hehe, ERROR: /mnt/backup/.snapshot does not exist. – Zulakis Sep 22 '12 at 15:41
  • no_create_root DOES prevent rsnapshot from creating the backup directory. Instead it just stops, as I already pointed out in my initial posting. – Zulakis Sep 22 '12 at 15:42
  • Yes, exactly. This is what you (should) want. Your mount script failed, so you need to prevent rsnapshot from doing the backup anyway. What else should it do about this problem? You could enhance your preexec mount script to inform you if it failed so you at least notice it. – Sven Sep 22 '12 at 15:45
  • rsnapshot checks if the directory exists BEFORE executing the mount-script. That's what i'm trying to point out. – Zulakis Sep 22 '12 at 15:49
  • And because of this I got to risk backing up to the wrong server, which I really don't want. – Zulakis Sep 22 '12 at 15:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.