[Request] Run custom script(s) before backing up
Hi,
First of all, thanks for this amazing project, I LOVE it!
Before using Zerobyte, I just used a simple bash script that ran a Restic CLI command every night. The script basically created some database dumps before running the actual backup:
# Export Wiki.js db
docker compose -f /stacks/wiki-js/compose.yaml exec db pg_dump wiki -U wikijs -F c > /stacks/wiki-js/wiki-js-db.dump
restic -r /mnt/restic --verbose backup /stacks
restic -r /mnt/restic --verbose forget --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --prune
This script made sure critical database backups were included in my Restic backup. Would it be possible to achieve this with Zerobyte?
Hello, thank you very much! The problem I see here is that Zerobyte runs in a docker container so even if I give you the option to run a script before a backup it would be run from inside the container and your options would be limited to what is installed/available in the container runtime. Example if someone uses a python script it would not work or if you use pgsql you would miss the binary.
I can probably add this feature if I make it very clear that it will be run from the constrained environment of the container
@nicotsx you are right, probably doesn't make much sense to include this feature then
To add to this, I would love to be able to run a script/command after a backup.
To just curl my healthchecks instance to state that it has finished the backup.
So if the backup doesn't finish because the zerobyte container is down or any other reason I still get notified.
Thanks for the issue, we'll track the progress in #64 closing this one