ZoopaMario
db7d5a154a
Add a library file containing common logic to be sourced by individual backup scripts
31 lines
683 B
Bash
Executable file
31 lines
683 B
Bash
Executable file
#!/bin/bash
|
|
SCRIPT_ABS_LOCATION=$(realpath "$(dirname "${0}")")
|
|
|
|
# shellcheck disable=SC1090
|
|
source "$SCRIPT_ABS_LOCATION/portainer-backup.env"
|
|
source "$SCRIPT_ABS_LOCATION/../logger.sh"
|
|
source "$SCRIPT_ABS_LOCATION/../common-backup.sh"
|
|
|
|
# shellcheck disable=SC2034
|
|
LOG_FILE="$SCRIPT_ABS_LOCATION/portainer-backup.log"
|
|
|
|
APP_CONTAINER="portainer"
|
|
BACKUP_CONTAINER="duplicati"
|
|
SOURCE_DIR="/volumes/portainer"
|
|
|
|
stop_container "$APP_CONTAINER"
|
|
|
|
run_duplicati_backup \
|
|
"$BACKUP_CONTAINER" \
|
|
"$BACKUP_DESTINATION" \
|
|
"portainer" \
|
|
7 \
|
|
"$SFTP_USERNAME" \
|
|
"$SFTP_PASSWORD" \
|
|
"$BACKUP_ENCR_PASSPHRASE" \
|
|
"$SFTP_FINGERPRINT" \
|
|
"$SOURCE_DIR"
|
|
|
|
start_container "$APP_CONTAINER"
|
|
|