From 20284fa8bb6dc6907bc6d4143ff0d95b65c5ae64 Mon Sep 17 00:00:00 2001 From: Paul Wilde Date: Tue, 17 Jan 2023 12:30:11 +0000 Subject: [PATCH] rebuild of backup command --- backup.sh | 8 +++++++- env.sample.sh | 0 init.sh | 0 snapshots.sh | 0 4 files changed, 7 insertions(+), 1 deletion(-) mode change 100644 => 100755 backup.sh mode change 100644 => 100755 env.sample.sh mode change 100644 => 100755 init.sh mode change 100644 => 100755 snapshots.sh diff --git a/backup.sh b/backup.sh old mode 100644 new mode 100755 index 13edbb9..38a5244 --- a/backup.sh +++ b/backup.sh @@ -1,7 +1,13 @@ #!/bin/bash source env.sh echo "Backup $NAME at $DATE" -BACKUP_CMD=restic backup $BACKUP_DIR $BACKUP_PARAMS -e $BACKUP_EXCLUSIONS +BACKUP_CMD=restic backup $BACKUP_DIR +if [[ $BACKUP_PARAMS ]]; then + BACKUP_CMD=$BACKUP_CMD $BACKUP_PARAMS +fi +if [[ $BACKUP_EXCLUDE_FILE ]]; then + BACKUP_CMD=$BACKUP_CMD --exclude-file $BACKUP_EXCLUDE_FILE +fi running=$(pgrep -f "$BACKUP_CMD") if [[ $running ]]; then echo "Backup alreadying running : $running. Exiting..." diff --git a/env.sample.sh b/env.sample.sh old mode 100644 new mode 100755 diff --git a/init.sh b/init.sh old mode 100644 new mode 100755 diff --git a/snapshots.sh b/snapshots.sh old mode 100644 new mode 100755