Skip to content

Commit

Permalink
Merge pull request #46 from PhasecoreX/patch-3
Browse files Browse the repository at this point in the history
Add RESTIC_PRUNE_ARGS
  • Loading branch information
djmaze authored Jun 16, 2020
2 parents 209836c + 705d931 commit 5cca3fd
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ E.g.
* `RESTIC_BACKUP_ARGS` - If specified `restic backup` is run with the given arguments, e.g. for tags, exclude definitions, or verbose logging: `--tag docker-volumes --exclude-file='exclude.txt' --verbose`. See the [restic backup documentation](https://restic.readthedocs.io/en/stable/040_backup.html) for available options
* `RESTIC_BACKUP_TAGS` - *Deprecated*. Tags to set for each snapshot, separated by commas. This option will soon be removed. Please use `RESTIC_BACKUP_ARGS` to define tags.
* `RESTIC_FORGET_ARGS` - If specified `restic forget` is run with the given arguments after each backup, e.g. `--prune --keep-last 14 --keep-daily 1`. See the [restic forget documentation](https://restic.readthedocs.io/en/stable/060_forget.html) for available options
* `RESTIC_PRUNE_ARGS` - If specified `restic prune` is run with the given arguments, e.g. for B2 concurrent connection settings and verbose logging: `-o b2.connections=10 --verbose`.
* (Additional variables as needed for the chosen backup target. E.g. `B2_ACCOUNT_ID` and `B2_ACCOUNT_KEY` for Backblaze B2. See official restic documentation about [supported environment variables](https://restic.readthedocs.io/en/stable/040_backup.html#environment-variables).)
* `TZ` - Optional. Set your timezone for the correct cron execution time.

Expand Down
2 changes: 1 addition & 1 deletion prune
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ main() {
echo Starting prune at "$(date +"%Y-%m-%d %H:%M:%S")"

set +e
if ! restic prune "${RESTIC_REPOSITORY}"; then
if ! restic prune ${RESTIC_PRUNE_ARGS:-} "${RESTIC_REPOSITORY}"; then
set -e
run_commands "${POST_COMMANDS_FAILURE:-}"
exit
Expand Down

0 comments on commit 5cca3fd

Please sign in to comment.