rebuild of backup command

This commit is contained in:
Paul Wilde 2023-01-17 12:30:11 +00:00
parent b0233944c2
commit 20284fa8bb
4 changed files with 7 additions and 1 deletions

8
backup.sh Normal file → Executable file
View file

@ -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..."

0
env.sample.sh Normal file → Executable file
View file

0
init.sh Normal file → Executable file
View file

0
snapshots.sh Normal file → Executable file
View file