ZoopaMario
ba2987dbea
All checks were successful
Lint Bash Scripts / lint-bash (push) Successful in 27s
- Add a library file containing common logic to be sourced by individual backup scripts - Integrate logger file as it so far only contained a single method - Make sure all relevant variables are defined within the related .env file - Remove the option to pass command line arguments to the script
34 lines
1 KiB
Bash
Executable file
34 lines
1 KiB
Bash
Executable file
#!/bin/bash
|
|
SCRIPT_ABS_LOCATION=$(realpath "$(dirname "$0")")
|
|
|
|
# shellcheck disable=SC1090
|
|
source "$SCRIPT_ABS_LOCATION/../common-backup.sh"
|
|
# shellcheck disable=SC1090
|
|
source "$SCRIPT_ABS_LOCATION/cryptpad-backup.env"
|
|
|
|
# shellcheck disable=SC2034
|
|
LOG_FILE="$SCRIPT_ABS_LOCATION/cryptpad-backup.log"
|
|
|
|
log "Cleaning up inactive files..."
|
|
docker exec "$APP_CONTAINER" /usr/local/bin/node scripts/evict-inactive.js --workdir=/cryptpad || { log "Error cleaning up inactive files"; exit 1; }
|
|
|
|
log "Cleaning up archived files..."
|
|
docker exec "$APP_CONTAINER" /usr/local/bin/node scripts/evict-archived.js --workdir=/cryptpad || { log "Error cleaning up archived files"; exit 1; }
|
|
|
|
run_duplicati_backup \
|
|
"$BACKUP_DESTINATION" \
|
|
"$APP_CONTAINER" \
|
|
7 \
|
|
"$SFTP_USERNAME" \
|
|
"$SFTP_PASSWORD" \
|
|
"$SFTP_FINGERPRINT" \
|
|
"$BACKUP_ENCR_PASSPHRASE" \
|
|
"$SOURCE_DIR/data" \
|
|
"$SOURCE_DIR/datastore" \
|
|
"$SOURCE_DIR/block" \
|
|
"$SOURCE_DIR/blob" \
|
|
"$SOURCE_DIR/config/config.js" \
|
|
"$SOURCE_DIR/customize" \
|
|
"$SOURCE_DIR/customize.dist"
|
|
|