我每小时都会进行快照备份,每次备份都会在 中创建文件/etc/lvm/archive
。但是 lvm 似乎没有注意到 中“backup”下的“retain_days”参数/etc/lvm/lvm.conf
,因为我那里有 9000 多个文件,可以追溯到 2012 年。我应该设置一个 cron 作业来自己清除它们吗?
这是配置文件的备份部分:
# 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
}
答案1
配置参数用于最低限度天的保留。没有最大保留的配置。我设置了一个 crontab 条目来删除旧的。