mirror of
https://github.com/offen/docker-volume-backup.git
synced 2026-04-14 21:35:36 +02:00
Update existing tests and test actual pruning
This commit is contained in:
@@ -25,7 +25,7 @@ services:
|
||||
BACKUP_FILENAME_EXPAND: 'true'
|
||||
BACKUP_FILENAME: test-$$HOSTNAME.tar.gz
|
||||
BACKUP_CRON_EXPRESSION: 0 0 5 31 2 ?
|
||||
BACKUP_RETENTION_DAYS: ${BACKUP_RETENTION_DAYS:-7}
|
||||
BACKUP_RETENTION_PERIOD: ${BACKUP_RETENTION_PERIOD:-168h}
|
||||
BACKUP_PRUNING_LEEWAY: 5s
|
||||
BACKUP_PRUNING_PREFIX: test
|
||||
volumes:
|
||||
|
||||
@@ -22,9 +22,11 @@ docker run --rm \
|
||||
|
||||
pass "Found relevant files in untared remote backups."
|
||||
|
||||
sleep 5
|
||||
|
||||
# The second part of this test checks if backups get deleted when the retention
|
||||
# is set to 0 days (which it should not as it would mean all backups get deleted)
|
||||
BACKUP_RETENTION_DAYS="0" docker compose up -d
|
||||
BACKUP_RETENTION_PERIOD="5s" docker compose up -d
|
||||
sleep 5
|
||||
|
||||
docker compose exec backup backup
|
||||
@@ -39,7 +41,7 @@ pass "Remote backups have not been deleted."
|
||||
# The third part of this test checks if old backups get deleted when the retention
|
||||
# is set to 7 days (which it should)
|
||||
|
||||
BACKUP_RETENTION_DAYS="7" docker compose up -d
|
||||
BACKUP_RETENTION_PERIOD="168h" docker compose up -d
|
||||
sleep 5
|
||||
|
||||
info "Create first backup with no prune"
|
||||
|
||||
Reference in New Issue
Block a user