From 347322d9c9e4fb129dca309c4db8804be93166db Mon Sep 17 00:00:00 2001 From: Ante de Baas <5467398+antedebaas@users.noreply.github.com> Date: Wed, 8 Mar 2023 10:53:20 +0100 Subject: [PATCH] pre_backup commands (#107) * pre_backup list * add $INSTALL_PREFIX * make it executable * remove pre_backup.txt * fix quotes Co-authored-by: Erik Westrup --------- Co-authored-by: Erik Westrup --- bin/restic_backup.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/restic_backup.sh b/bin/restic_backup.sh index 651991e..520bce0 100644 --- a/bin/restic_backup.sh +++ b/bin/restic_backup.sh @@ -44,6 +44,9 @@ assert_envvars \ IFS=':' read -ra backup_paths <<< "$RESTIC_BACKUP_PATHS" IFS=' ' read -ra extra_args <<< "$RESTIC_BACKUP_EXTRA_ARGS" +#run the commands listed here before running the actual backup. +PRE_SCRIPT="${INSTALL_PREFIX}/etc/restic/pre_backup.sh" +test -x "$PRE_SCRIPT" && "$PRE_SCRIPT" # Set up exclude files: global + path-specific ones # NOTE that restic will fail the backup if not all listed --exclude-files exist. Thus we should only list them if they are really all available.