diff --git a/CHANGELOG.md b/CHANGELOG.md index d922b92..5adb01c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Added - Allow extra arguments to restic-backup with `$RESTIC_BACKUP_EXTRA_ARGS`. +- Add `$RESTIC_VERBOSITY_LEVEL` for debugging. ### Changed - Align terminology used in README with the one used by B2 for credentials (keyId + applicationKey pair). diff --git a/etc/restic/_global.env.template b/etc/restic/_global.env.template index 560ade3..f6ea41d 100644 --- a/etc/restic/_global.env.template +++ b/etc/restic/_global.env.template @@ -22,3 +22,7 @@ export B2_CONNECTIONS=10 # Extra args to restic-backup. This is empty here and profiles can override this after sourcing this file. export RESTIC_BACKUP_EXTRA_ARGS= + +# Verbosity level from 0-3. 0 means no --verbose. +# Override this value in a profile if needed. +export RESTIC_VERBOSITY_LEVEL=0 diff --git a/usr/local/sbin/restic_backup.sh b/usr/local/sbin/restic_backup.sh index 6299777..b4f19b3 100644 --- a/usr/local/sbin/restic_backup.sh +++ b/usr/local/sbin/restic_backup.sh @@ -47,7 +47,7 @@ wait $! # --one-file-system makes sure we only backup exactly those mounted file systems specified in $BACKUP_PATHS, and thus not directories like /dev, /sys etc. # --tag lets us reference these backups later when doing restic-forget. restic backup \ - --verbose \ + --verbose=$RESTIC_VERBOSITY_LEVEL \ --one-file-system \ --tag $BACKUP_TAG \ --option b2.connections=$B2_CONNECTIONS \ @@ -60,7 +60,7 @@ wait $! # See restic-forget(1) or http://restic.readthedocs.io/en/latest/060_forget.html # --group-by only the tag and path, and not by hostname. This is because I create a B2 Bucket per host, and if this hostname accidentially change some time, there would now be multiple backup sets. restic forget \ - --verbose \ + --verbose=$RESTIC_VERBOSITY_LEVEL \ --tag $BACKUP_TAG \ --option b2.connections=$B2_CONNECTIONS \ --prune \ diff --git a/usr/local/sbin/restic_check.sh b/usr/local/sbin/restic_check.sh index 58d3518..019677c 100644 --- a/usr/local/sbin/restic_check.sh +++ b/usr/local/sbin/restic_check.sh @@ -23,5 +23,5 @@ trap exit_hook INT TERM # Check repository for errors. restic check \ --option b2.connections=$B2_CONNECTIONS \ - --verbose & + --verbose=$RESTIC_VERBOSITY_LEVEL & wait $!