mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2026-04-25 17:25:57 +03:00
[GH-ISSUE #247] Add cron job for sql backup for docker image #124
Labels
No labels
SSO
Third party
better for forum
bug
bug
documentation
duplicate
enhancement
future Vault
future Vault
future Vault
good first issue
help wanted
low priority
notes
pull-request
question
troubleshooting
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/vaultwarden#124
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @ghost on GitHub (Nov 13, 2018).
Original GitHub issue: https://github.com/dani-garcia/vaultwarden/issues/247
Hi all,
Is it possible to add cron job for sql backup in docker image? Everytime I want update container I need to do database backup manually, it would be better to have cron job for this inside container running every hour or day or possibility to configure this variable during container configuration.
@strayer commented on GitHub (Nov 13, 2018):
You essentially have two options, both require a container to share the volume that bitwarden_rs uses.
A) Run a sqlite container periodically via the Docker hosts crontab
B) Build a container with a cron daemon (e.g. dcron) and run the sqlite backup command in it
Option A is trivial, option B is a little more complicated since its horribly annoying getting a cron daemon to work correctly in a Docker container. I'm technically doing something similar than option A… I'm rebuilding and restarting all containers on my hosts daily with a cronjob anyway to cover potential security updates and simply run the sqlite backup before, directly on the Docker host.
This obviously doesn't work on a Kubernetes/Docker Swarm setup, but then again… if you are running a cluster you should be able to get option B running easily.
@ghost commented on GitHub (Nov 13, 2018):
I am asking about B). There is a docker image but without cron job https://hub.docker.com/r/mprasil/bitwarden/
@mprasil commented on GitHub (Nov 13, 2018):
We're not going to add cron (and other related utilities) into the bitwarden_rs image to keep the image relatively simple and small.
There's a ton of images with cron out there, you can just use those and mount the same volume your bitwarden_rs server is using.
Hope that makes sense.
@mprasil commented on GitHub (Nov 13, 2018):
Having said that, if someone feels like writing a documentation about how to achieve cron backup with external container and shared volume, the PR would be very appreciated.
@Bruceforce commented on GitHub (Nov 17, 2018):
@mprasil Would something like this be useful for the documentation?
https://gitlab.com/1O/bitwarden_rs-backup/tree/master
I outlined an automatic and a manual solution there.
@mprasil commented on GitHub (Nov 17, 2018):
I think it would! You can create a PR to update the readme and link to your repo or something like that.