I do hourly backups doing snapshots, and every time I do it creates files in /etc/lvm/archive
. But lvm doesn't appear to pay any attention to the "retain_days" parameter under "backup" in /etc/lvm/lvm.conf
, because I've got 9000+ files there, going back to 2012. Should I set up a cron job to purge them myself?
Here's the backup section of the config file:
# Configuration of metadata backups and archiving. In LVM2 when we
# talk about a 'backup' we mean making a copy of the metadata for the
# *current* system. The 'archive' contains old metadata configurations.
# Backups are stored in a human readeable text format.
backup {
# Should we maintain a backup of the current metadata configuration ?
# Use 1 for Yes; 0 for No.
# Think very hard before turning this off!
backup = 1
# Where shall we keep it ?
# Remember to back up this directory regularly!
backup_dir = "/etc/lvm/backup"
# Should we maintain an archive of old metadata configurations.
# Use 1 for Yes; 0 for No.
# On by default. Think very hard before turning this off.
archive = 1
# Where should archived files go ?
# Remember to back up this directory regularly!
archive_dir = "/etc/lvm/archive"
# What is the minimum number of archive files you wish to keep ?
retain_min = 10
# What is the minimum time you wish to keep an archive file for ?
retain_days = 30
}
The config parameter is for minimum days retention. There is no configuration for maximum retention. I've setup a crontab entry to remove old ones.