feat: backupvolume can be pruned after upload
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Philipp Rothmann 2023-03-01 13:28:39 +01:00
parent bab224ab96
commit 92dfd23b26
3 changed files with 8 additions and 2 deletions

View File

@ -8,6 +8,7 @@ SERVER_NAME=example.com
RESTIC_HOST=minio.example.com
CRON_SCHEDULE='*/5 * * * *'
REMOVE_BACKUP_VOLUME_AFTER_UPLOAD=1
# swarm-cronjob, instead of built-in cron
#COMPOSE_FILE="$COMPOSE_FILE:compose.swarm-cronjob.yml"

View File

@ -72,7 +72,7 @@ else
fi
if [[ \ $*\ != *\ --skip-backup\ * ]]; then
rm -rf "${backup_path}"
rm -rf "${backup_path}"
for service in "${services[@]}"; do
echo "service: $service"
@ -122,5 +122,9 @@ fi
if [[ \ $*\ != *\ --skip-upload\ * ]]; then
_restic backup --host "$server_name" --tag coop-cloud "$backup_path"
fi
if [ "$REMOVE_BACKUP_VOLUME_AFTER_UPLOAD" -eq 1 ]; then
echo "Cleaning up ${backup_path}"
rm -rf "${backup_path}"
fi
fi

View File

@ -14,6 +14,7 @@ services:
- BACKUP_DEST=/backups
- RESTIC_HOST
- SERVER_NAME
- REMOVE_BACKUP_VOLUME_AFTER_UPLOAD=1
secrets:
- restic_password
deploy: