Re: Make ZFS auto-destroy snapshots when the out of space?

看板FB_stable作者時間15年前 (2010/05/31 09:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串16/23 (看更多)
On May 30, 2010, at 7:34 PM, Christof Schulze wrote: > still struggling with the attachment remover. So here is the script: > > http://paste.pocoo.org/show/220207/ That's pretty similar in concept to the scripts I found and am using, but with the difference that those scripts use "zfs snapshot -r" to take a recursive, atomic snapshot of all filesystems in the configured pools. I wrote a separate script to prune all the unwanted filesystems (/tmp, and so on) regularly: #!/bin/sh # If there is a global system configuration file, suck it in. # if [ -r /etc/defaults/periodic.conf ] then . /etc/defaults/periodic.conf source_periodic_confs fi filesystems=$hourly_zfs_snapshot_prune_filesystems case "$hourly_zfs_snapshot_prune_enable" in [Yy][Ee][Ss]) if [ -z "$filesystems" ]; then echo "Hourly snapshot pruning is enabled but not configured." exit 2 fi for filesystem in $filesystems ; do zfs list -H -o name -t snapshot | grep -E "^ $filesystem@(hourly|daily|weekly|monthly)" | xargs -n1 zfs destroy done ;; *) ;; esac -- Kirk Strauser _______________________________________________ freebsd-stable@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-stable To unsubscribe, send any mail to "freebsd-stable-unsubscribe@freebsd.org"
文章代碼(AID): #1C0mfFpD (FB_stable)
討論串 (同標題文章)
完整討論串 (本文為第 16 之 23 篇):
文章代碼(AID): #1C0mfFpD (FB_stable)