zerobyte icon indicating copy to clipboard operation
zerobyte copied to clipboard

[Request] Run custom script(s) before backing up

Open robiningelbrecht opened this issue 3 months ago • 3 comments

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?

robiningelbrecht avatar Nov 21 '25 13:11 robiningelbrecht

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 avatar Nov 21 '25 17:11 nicotsx

@nicotsx you are right, probably doesn't make much sense to include this feature then

robiningelbrecht avatar Nov 21 '25 19:11 robiningelbrecht

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.

Proximus888 avatar Dec 16 '25 15:12 Proximus888

Thanks for the issue, we'll track the progress in #64 closing this one

nicotsx avatar Jan 06 '26 17:01 nicotsx