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

Allow custom backup arguments using RESTIC_BACKUP_ARGS #38

Merged
merged 1 commit into from
Jun 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ E.g.
* `RESTIC_REPOSITORY` - location of the restic repository. You can use [any target supported by restic](https://restic.readthedocs.io/en/stable/030_preparing_a_new_repo.html). Default `/mnt/restic`
* `RESTIC_BACKUP_SOURCES` - source directory to backup. Make sure to mount this into the container as a volume (see the example configs). Default `/data`
* `RESTIC_PASSWORD` - password for the restic repository. Will also be used to initialize the repository if it is not yet initialized
* `RESTIC_BACKUP_ARGS` - Optional. Additional arguments given to *restic backup*.
* `RESTIC_BACKUP_TAGS` - Optional. Tags to set on each snapshot, separated by commas. E.g. `swarm,docker-volumes`
* `RESTIC_FORGET_ARGS` - Optional. If specified `restic forget` is run with the given arguments after each backup. E.g. `--prune --keep-last 14 --keep-daily 1`
* (Additional variables as needed for the chosen backup target. E.g. `B2_ACCOUNT_ID` and `B2_ACCOUNT_KEY` for Backblaze B2.)
Expand Down
2 changes: 1 addition & 1 deletion backup
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ start=`date +%s`
echo Starting Backup at $(date +"%Y-%m-%d %H:%M:%S")

set +e
restic backup ${tag_options} ${RESTIC_BACKUP_SOURCES}
restic backup ${RESTIC_BACKUP_ARGS:-} ${tag_options} ${RESTIC_BACKUP_SOURCES}
if [ $? -ne 0 ]
then
set -e
Expand Down
1 change: 1 addition & 0 deletions docker-compose.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ services:
RESTIC_REPOSITORY: b2:my-repo:/restic
RESTIC_PASSWORD: supersecret
RESTIC_BACKUP_SOURCES: /mnt/volumes
#RESTIC_BACKUP_ARGS: -v
RESTIC_BACKUP_TAGS: docker-volumes
RESTIC_FORGET_ARGS: --prune --keep-last 14 --keep-daily 1
B2_ACCOUNT_ID: xxxxxxx
Expand Down
1 change: 1 addition & 0 deletions docker-swarm.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ services:
RESTIC_REPOSITORY: b2:my-repo:/restic
RESTIC_PASSWORD: supersecret
RESTIC_BACKUP_SOURCES: /mnt/volumes
#RESTIC_BACKUP_ARGS: -v
RESTIC_BACKUP_TAGS: docker-volumes
RESTIC_FORGET_ARGS: --prune --keep-last 14 --keep-daily 1
B2_ACCOUNT_ID: xxxxxxx
Expand Down