问题原文
原帖链接 · Greg · CC BY-SA 3.0
Using the below zfs-auto-snapshot commands, how to specify to keep 52 weekly snapshots and infinite number of monthly snapshots?
sudo zfs set com.sun:auto-snapshot=true storage
sudo zfs set com.sun:auto-snapshot:weekly=true storage
sudo zfs set com.sun:auto-snapshot:monthly=true storage
When I specified it as a keyword or argument it failed both times:
sudo zfs set com.sun:auto-snapshot:weekly=true storage keep=52
cannot open 'keep=52': invalid dataset name
sudo zfs set com.sun:auto-snapshot:weekly=true storage --keep=52
cannot open '--keep=52': invalid dataset name
已采纳解答
原帖链接 · ewwhite · CC BY-SA 3.0
Here is a sample of one of my system's /etc/cron.d/zfs-auto-snapshot.
PATH="/usr/bin:/bin:/usr/sbin:/sbin"
*/5 * * * * root /sbin/zfs-auto-snapshot -q -g --label=frequent --keep=24 //
00 * * * * root /sbin/zfs-auto-snapshot -q -g --label=hourly --keep=24 //
59 23 * * * root /sbin/zfs-auto-snapshot -q -g --label=daily --keep=14 //
59 23 * * 0 root /sbin/zfs-auto-snapshot -q -g --label=weekly --keep=4 //
00 00 1 * * root /sbin/zfs-auto-snapshot -q -g --label=monthly --keep=18 //
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
