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