feat: backupvolume can be pruned after upload
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
bab224ab96
commit
92dfd23b26
|
@ -8,6 +8,7 @@ SERVER_NAME=example.com
|
||||||
RESTIC_HOST=minio.example.com
|
RESTIC_HOST=minio.example.com
|
||||||
|
|
||||||
CRON_SCHEDULE='*/5 * * * *'
|
CRON_SCHEDULE='*/5 * * * *'
|
||||||
|
REMOVE_BACKUP_VOLUME_AFTER_UPLOAD=1
|
||||||
|
|
||||||
# swarm-cronjob, instead of built-in cron
|
# swarm-cronjob, instead of built-in cron
|
||||||
#COMPOSE_FILE="$COMPOSE_FILE:compose.swarm-cronjob.yml"
|
#COMPOSE_FILE="$COMPOSE_FILE:compose.swarm-cronjob.yml"
|
||||||
|
|
|
@ -72,7 +72,7 @@ else
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ \ $*\ != *\ --skip-backup\ * ]]; then
|
if [[ \ $*\ != *\ --skip-backup\ * ]]; then
|
||||||
rm -rf "${backup_path}"
|
rm -rf "${backup_path}"
|
||||||
|
|
||||||
for service in "${services[@]}"; do
|
for service in "${services[@]}"; do
|
||||||
echo "service: $service"
|
echo "service: $service"
|
||||||
|
@ -122,5 +122,9 @@ fi
|
||||||
|
|
||||||
if [[ \ $*\ != *\ --skip-upload\ * ]]; then
|
if [[ \ $*\ != *\ --skip-upload\ * ]]; then
|
||||||
_restic backup --host "$server_name" --tag coop-cloud "$backup_path"
|
_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
|
||||||
|
|
|
@ -14,6 +14,7 @@ services:
|
||||||
- BACKUP_DEST=/backups
|
- BACKUP_DEST=/backups
|
||||||
- RESTIC_HOST
|
- RESTIC_HOST
|
||||||
- SERVER_NAME
|
- SERVER_NAME
|
||||||
|
- REMOVE_BACKUP_VOLUME_AFTER_UPLOAD=1
|
||||||
secrets:
|
secrets:
|
||||||
- restic_password
|
- restic_password
|
||||||
deploy:
|
deploy:
|
||||||
|
|
Loading…
Reference in New Issue