Skip to content
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

Fix various things & add support for precommands #3

Open
wants to merge 4 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@jlelse
Copy link
Contributor

commented Jun 17, 2019

This PR has the following changes:

  • Use specific go version in Dockerfile (in case anything should break in future versions)
  • Add tzdata package (to be able to set the correct time zone using the TZ env variable)
  • Add support for "pre-commands", so one can execute commands before the backup actually starts. For this bash and docker-cli are added. When mounting the docker socket it's possible to execute commands in other containers. That's probably not Docker best practices, but I was inspired by my old backup solution which had support for something similar to this (https://github.com/blacklabelops/volumerize/).
@djmaze

This comment has been minimized.

Copy link
Owner

commented Jul 10, 2019

Thanks for the PR (and sorry for the late reply).

The go version and tzdata changes are good to go.

Concerning the PRE_COMMANDS variable: forgive my bash weakness, but with the current approach, how can you add commands consisting of multiple words?

@jlelse

This comment has been minimized.

Copy link
Contributor Author

commented Jul 11, 2019

I use the PRE_COMMANDS env var like this in my docker-compose.yml file:

restic:
        ...
        environment:
            TZ: Europe/Berlin
            BACKUP_CRON: "0 0 2 * * *"
            ...
            PRE_COMMANDS: |-
                docker exec miniflux-db pg_dumpall -U miniflux -f /data/miniflux.sql
                docker exec nextcloud-postgres pg_dumpall -U nextcloud -f /data/nextcloud.sql
                docker exec pleroma-postgres pg_dumpall -U pleroma -f /data/pleroma.sql
@djmaze

This comment has been minimized.

Copy link
Owner

commented Jul 11, 2019

That looks cool! So let's take this in.

We need some documentation about the usage of the TZ variable and the PRE_COMMANDS (maybe with an example). Any chance you could at that to the PR? I'd have a stab at it otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.