introduce new config option BACKUP_ARGS to add additional parameters to backup job (like tagging the backup)

new option is set to empty if not specified otherwise.

as suggested in https://github.com/binarybucks/restic-tools/pull/14#issuecomment-359700589

Signed-off-by: Felix Bartels <felix@host-consultants.de>
This commit is contained in:
Felix Bartels 2018-01-21 11:39:00 +01:00
parent 448b04a3da
commit 696f416aa2
2 changed files with 5 additions and 1 deletions

View file

@ -54,11 +54,14 @@ do_local_backup () {
. /etc/backup/local.config . /etc/backup/local.config
# define an empty default if BACKUP_ARGS is not set
BACKUP_ARGS=${BACKUP_ARGS:-""}
if [[ -x /etc/backup/local.pre ]]; then if [[ -x /etc/backup/local.pre ]]; then
/etc/backup/local.pre $TARGET /etc/backup/local.pre $TARGET
fi fi
$RESTIC --exclude-file /etc/backup/local.exclude backup --hostname $BACKUP_HOSTNAME $BACKUP_DIR $RESTIC --exclude-file /etc/backup/local.exclude backup --hostname $BACKUP_HOSTNAME $BACKUP_ARGS $BACKUP_DIR
if [[ -x /etc/backup/local.post ]]; then if [[ -x /etc/backup/local.post ]]; then
/etc/backup/local.post $TARGET /etc/backup/local.post $TARGET

View file

@ -1,3 +1,4 @@
BACKUP_HOSTNAME="backuphost.example.org" BACKUP_HOSTNAME="backuphost.example.org"
BACKUP_DIR="/" BACKUP_DIR="/"
BACKUP_ARGS="--tag filesystem"
# HEALTHCHECK_URL="<URL from https://healthchecks.io/checks/ to notify>" # HEALTHCHECK_URL="<URL from https://healthchecks.io/checks/ to notify>"