Skip to main content
Kill -9 Club
Sign in

retention

Backups

How long you keep an archive before deleting it. You pick the number by measuring: du -sh /var/backups/* says what one day of backups costs, and the space available divided by that cost gives you the window. What gets skipped is the guard. find /var/backups -name '*.dump' -mtime +30 -delete in a nightly timer is not rotation. On the thirty-first day after backups quietly stopped producing files, that line erases the last valid copy — exactly the day it is the only thing left. Rotation is the same command with a condition in front of it: count the archives newer than two days, exit non-zero when the count is zero, and delete only after that. And read the list with -print before ever typing -delete. Without the condition, retention is a scheduled destruction with a reassuring name.

Also written: retention window, retention policy