-
-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
docker-volume-backup.archive-pre get executed in each container #129
Comments
So from what I can understand from your log output, you have a I'm not sure I understand your question yet, but do you want to prevent the From the README:
Also see the second section here: https://github.com/offen/docker-volume-backup#run-custom-commands-during-the-backup-lifecycle |
No, IMO the mapping is broken. Take a look on the schedule
At 2am, the first backup is scheduled: gollum. From the first log, you see that crond (pid 199) get executed for gollum. So far so good. But then, it tries to dump the DB... |
This is the expected behavior, unless you use It's important to understand that the command has no way of knowing how the volumes/mounts being backed up map to containers. If you backup the volume containing your data, the command does not know which other containers are using the volume. |
From the label (like for example traefik do that)? With |
This is explained in the README: https://github.com/offen/docker-volume-backup#run-custom-commands-during-the-backup-lifecycle In you particular case, you'd have labels like: labels:
- docker-volume-backup.archive-pre=/bin/sh -c 'mysqldump -p $MYSQL_ROOT_PASSWORD --all-databases > /config/backup.sql'
- docker-volume-backup.archive-post=/bin/sh -c 'rm /config/backup.sql'
- docker-volume-backup.exec-label=mariadb and then set |
Thanks for the support. Will test it |
Hmm, proposed solution doesn't work. Still it executes the DB dump commands for each volume / container. Example log from syslog-ng volume/container:
Relevant config:
|
Do you also use an |
No, I have currently two labels. One for I'm aware of your example, but this is not 1:1 compare with my setup since mine is unfortunately more complex. Things that are different are:
Just some rough ideas, where my setup can be broken. Do we have the possibility to further increase the debug level? I would like to check if the environment variables are correct set per |
There's no option to increase verbosity or something no. |
Convinced that we have a bug ;-)
|
Again, your example shows expected behavior. The first invocation does not set an If you still think this is a bug, please extend the matching test case in this repo to fail when it shouldn't and I will have a look, otherwise I can't spend too much time on this issue here anymore. Thanks for your understanding. |
Hey @m90, Ok now was able now to fix the config. From the #129 (comment) it was not clear to me that is not enough to include the An example for other user if they have the same difficulties to understand ;-)
The secret source is now that we have
|
Hey,
I setup my backup like discussed in #123. Works as expected. To further improve my backup strategy, I would like to dump my DBs via
docker-volume-backup.archive-pre
. For example I add the 2 labels to my marinaDB container.My assumption was that the backup only executed this in the marinaDB container (since I add the label only there :-)). However, the logs say something different...
The text was updated successfully, but these errors were encountered: