diff --git a/CHANGELOG.md b/CHANGELOG.md index e2098aa..d922b92 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Added +- Allow extra arguments to restic-backup with `$RESTIC_BACKUP_EXTRA_ARGS`. + ### 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 4ce429f..560ade3 100644 --- a/etc/restic/_global.env.template +++ b/etc/restic/_global.env.template @@ -19,3 +19,6 @@ export B2_ACCOUNT_KEY="" # TODO fill with your applicationKe # How many network connections to set up to B2. Default is 5. 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= diff --git a/etc/restic/default.env.template b/etc/restic/default.env.template index 809b575..35fe1a0 100644 --- a/etc/restic/default.env.template +++ b/etc/restic/default.env.template @@ -32,3 +32,9 @@ export RETENTION_DAYS=14 export RETENTION_WEEKS=16 export RETENTION_MONTHS=18 export RETENTION_YEARS=3 + +# Optional extra arguments to restic-backup. +# Example: Add two additional exclude files to the global one in RESTIC_PASSWORD_FILE. +#RESTIC_BACKUP_EXTRA_ARGS="--exclude-file /path/to/extra/exclude/file/a /path/to/extra/exclude/file/b" +# Example: exclude all directories that have a .git/ directory inside it. +#RESTIC_BACKUP_EXTRA_ARGS="--exclude-if-present .git" diff --git a/usr/local/sbin/restic_backup.sh b/usr/local/sbin/restic_backup.sh index b135580..6299777 100644 --- a/usr/local/sbin/restic_backup.sh +++ b/usr/local/sbin/restic_backup.sh @@ -52,6 +52,7 @@ restic backup \ --tag $BACKUP_TAG \ --option b2.connections=$B2_CONNECTIONS \ $exclusion_args \ + $RESTIC_BACKUP_EXTRA_ARGS \ $BACKUP_PATHS & wait $!