From 28b56eed84974f5edd726719a8f6b5ed432842b7 Mon Sep 17 00:00:00 2001 From: Paul Wilde Date: Tue, 17 Jan 2023 12:49:13 +0000 Subject: [PATCH] test changes --- backup.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/backup.sh b/backup.sh index 38a5244..1041701 100755 --- a/backup.sh +++ b/backup.sh @@ -1,12 +1,13 @@ #!/bin/bash source env.sh +DATE=$(date +"%Y-%m-%d %H:%M:%S") echo "Backup $NAME at $DATE" -BACKUP_CMD=restic backup $BACKUP_DIR +BACKUP_CMD="restic backup $BACKUP_DIR" if [[ $BACKUP_PARAMS ]]; then - BACKUP_CMD=$BACKUP_CMD $BACKUP_PARAMS + BACKUP_CMD="$BACKUP_CMD $BACKUP_PARAMS" fi if [[ $BACKUP_EXCLUDE_FILE ]]; then - BACKUP_CMD=$BACKUP_CMD --exclude-file $BACKUP_EXCLUDE_FILE + BACKUP_CMD="$BACKUP_CMD --exclude-file $BACKUP_EXCLUDE_FILE" fi running=$(pgrep -f "$BACKUP_CMD") if [[ $running ]]; then @@ -15,12 +16,12 @@ if [[ $running ]]; then exit fi echo "Not currently running. Continuing..." -curl https://hc-ping.com/$HEALTH_UUID/start -$PRE_RUN_SCRIPTS +curl https://hc-ping.com/$HEALTHCHECK_UUID/start +$(pwd)/$PRE_RUN_SCRIPT $BACKUP_CMD if [[ $? == 0 ]]; then - $POST_RUN_SCRIPTS - curl https://hc-ping.com/$HEALTH_UUID + $POST_RUN_SCRIPT + curl https://hc-ping.com/$HEALTHCHECK_UUID else - curl https://hc-ping.com/$HEALTH_UUID/fail + curl https://hc-ping.com/$HEALTHCHECK_UUID/fail fi