We’re looking into using Duplicacy for backing up our Linux servers’ entire filesystem. I’ve created a backup policy that has a pre/post-backup script that does the following:
- Run “flush tables with read lock” on MySQL,
- Create LVM snapshot & readonly mount it on /mnt
- Unlock MySQL tables
- Start backup of /mnt
After backup in post-backup script:
- umount /mnt
- remove LVM snapshot
This works well, however I have noticed that when there is a non-zero exit code the backup still continues. So if something goes wrong while settings up the LVM snapshot duplicacy still continues even though there will be nothing in /mnt as no valid snapshot can be mounted.
Is there a way to control this behaviour from within duplicacy? If something goes wrong in the pre-backup script I would like to prevent duplicacy from running at all and be notified of this. I can built logic into the pre/post-backup scripts that notify me when something goes wrong, so no need to do that from within Duplicacy itself, but it would be great if I could also abort duplicacy if something goes wrong in the pre-backup script.