我每小时进行一次快照备份,每次执行时都会在/etc/lvm/archive创build文件。 但是lvm似乎没有注意到/etc/lvm/lvm.conf “backup”下的“retain_days”参数,因为我已经有了超过9000个文件,可以追溯到2012年。我应该设置一个cron工作来清除他们自己?
这是configuration文件的备份部分:
# 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 }
configuration参数是最短的天保留。 没有最大保留的configuration。 我已经设置了一个crontab项来删除旧的。