cleanup applies the retention policy from dbdock.config.json. It’s automatic (when runAfterBackup: true) and manual (via this command).
Options
Interactive preview (default)
Dry run
See what would happen without doing it:0 if there’s nothing to delete, so it’s safe in CI.
Force (no prompt)
For automated cleanup in cron jobs:Retention policy
Defined indbdock.config.json:
How the rules combine
- Start with all backups
- Sort by age, newest first
- The most recent
minBackupsare untouchable - Of the rest, delete anything exceeding
maxBackupsor older thanmaxAgeDays
minBackups always wins. If you have 3 backups and minBackups: 5, cleanup deletes nothing.

