docker-mc-backup
docker-mc-backup copied to clipboard
Support for pre/post-backup scripts
Implements both methods discussed in #68 through four new environment variables
PRE_BACKUP_SCRIPTPRE_BACKUP_SCRIPT_FILEPOST_BACKUP_SCRIPTPOST_BACKUP_SCRIPT_FILE
The non-*_FILE variables take precedence if both are specified.
Some things I want to address before merging:
- The pre-backup script runs after auto save has been disabled, and the post-backup script runs after it's been reenabled. Does this seem like the best way to do it?
- Ideally the post-backup script would still be able to run if the backup failed, to push a failure notification for example. But given the
set -eat the script's start the container will exit if the backup fails. - On that note, a way for the post-backup script to know how the backup went. Given that they're real scripts an argument would work, but so would an exported environment variable
- And on that note, in order to not force
set -euo pipefailon the scripts I'm not sourcing them, but that also means they can only see exported environment variables. I've added some exports for variables that I think would be useful, but it doesn't feel elegant to do it like that
Any updates on this? This feature would be much appreciated!
I somehow completely forgot about this PR. My bad.
I should have time to revisit it this weekend @jacobmichels