Open DrBlokmeister opened 2 years ago
Good idea, but not trivial to implement since Samba Backup does not store any information about backups. It's not using a database or something similar to manage such information like how long to keep a certain backup file. The cleanup is entirely based on the creation date (older backups get deleted first).
Could 'keep days' be implemented in the file name? It's not the prettiest solution, but that way the routine could just step through the files, compare creation date to keep days, and delete as needed? Variant on this could be using expiration timecode if one cares about it being cleaned up more regularly than 'after midnight'. If we're going crazy, you could have different local and remote expiration times, eg L{time} and R{time}. To save text space, maybe epoch/unix timestamps, possibly drop some of the least significant digit(s)?
EDIT: Or the thing I always forgets exists, hex encoding (of the unix timestamp). Or maybe base32 encoding for crazy adventures.
I run weekly and daily backups. The weekly backups I want to keep for a longer time than the daily backups to avoid using too much disk space while still having a few weeks of history. It would be nice to add the option keep_days to the manual backup service.
Proposed config: