Add nginx-proxy backup script

main
Marco von Rosenberg 2 years ago
parent e4c4410ba3
commit 0d32747552
  1. 15
      backups/nginx-proxy.sh

@ -0,0 +1,15 @@
# Immediatly exit on command failure (e)
# and quit on unset variables (u)
set -ue
export BACKUP_REPO=ssh://cttuebak/media/borg/cttue/nginx-proxy
export BACKUP_NAME_DATA="data_$(date -u +'%Y-%m-%dT%H:%M%Z')"
export BORG_PASSPHRASE=$(cat "$(dirname $0)/borg_passphrase.txt")
echo "Starting Backup of nginx-proxy data..."
/usr/bin/borg create --compression zstd --stats ${BACKUP_REPO}::${BACKUP_NAME_DATA} /srv/docker-containers/nginx-proxy/nginx-data
echo "Backup done. Pruning backup-repo..."
/usr/bin/borg prune -v --list --keep-daily=7 --keep-weekly=7 --keep-monthly=10 --keep-yearly=5 ${BACKUP_REPO}
echo "Done"
Loading…
Cancel
Save