mirror of
https://github.com/offen/docker-volume-backup.git
synced 2026-04-20 15:42:40 +02:00
Passing a full duration as retention period is more flexible
This commit is contained in:
@@ -7,7 +7,8 @@ nav_order: 3
|
||||
|
||||
# Automatically prune old backups
|
||||
|
||||
When `BACKUP_RETENTION_DAYS` is configured, the command will check if there are any archives in the remote storage backend(s) or local archive that are older than the given retention value and rotate these backups away.
|
||||
When `BACKUP_RETENTION_PERIOD` is configured, the command will check if there are any archives in the remote storage backend(s) or local archive that are older than the given retention value and rotate these backups away.
|
||||
The value is a duration as per Go's [`time.ParseDuration`][duration].
|
||||
|
||||
{: .note }
|
||||
Be aware that this mechanism looks at __all files in the target bucket or archive__, which means that other files that are older than the given deadline are deleted as well.
|
||||
@@ -23,7 +24,7 @@ services:
|
||||
environment:
|
||||
BACKUP_FILENAME: backup-%Y-%m-%dT%H-%M-%S.tar.gz
|
||||
BACKUP_PRUNING_PREFIX: backup-
|
||||
BACKUP_RETENTION_DAYS: '7'
|
||||
BACKUP_RETENTION_PERIOD: '168h'
|
||||
volumes:
|
||||
- ${HOME}/backups:/archive
|
||||
- data:/backup/my-app-backup:ro
|
||||
@@ -32,3 +33,5 @@ services:
|
||||
volumes:
|
||||
data:
|
||||
```
|
||||
|
||||
[duration]: https://pkg.go.dev/time#ParseDuration
|
||||
|
||||
Reference in New Issue
Block a user