From owner-freebsd-stable@FreeBSD.ORG Mon May 31 01:15:05 2010 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id ECA821065670 for ; Mon, 31 May 2010 01:15:05 +0000 (UTC) (envelope-from christof.schulze@gmx.com) Received: from mailout-eu.gmx.com (mailout-eu.gmx.com [213.165.64.42]) by mx1.freebsd.org (Postfix) with SMTP id 537DF8FC12 for ; Mon, 31 May 2010 01:15:05 +0000 (UTC) Received: (qmail invoked by alias); 31 May 2010 01:15:03 -0000 Received: from g228053210.adsl.alicedsl.de (EHLO klausdieter0815.dyndns.org) [92.228.53.210] by mail.gmx.com (mp-eu001) with SMTP; 31 May 2010 03:15:03 +0200 X-Authenticated: #56306756 X-Provags-ID: V01U2FsdGVkX1/iXatToqfixSthHgHnqxOruAxPzbELtqkA/z5gGN 0KWLT7soTL1YP6 Received: by myhost.mydomain.de (Postfix, from userid 1001) id A07FC1313E; Mon, 31 May 2010 03:15:03 +0200 (CEST) From: Christof Schulze To: freebsd-stable@freebsd.org Date: Mon, 31 May 2010 03:15:02 +0200 User-Agent: KMail/1.13.3 (FreeBSD/8.0-STABLE; KDE/4.4.3; amd64; ; ) References: <4C017419.9010909@strauser.com> <201005310234.47363.christof.schulze@gmx.com> <613D3C80-85F6-4A52-8C33-7F5AF18A3A2E@strauser.com> In-Reply-To: <613D3C80-85F6-4A52-8C33-7F5AF18A3A2E@strauser.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201005310315.03255.christof.schulze@gmx.com> X-Y-GMX-Trusted: 0 Subject: Re: Make ZFS auto-destroy snapshots when the out of space? X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 May 2010 01:15:06 -0000 Am Montag 31 Mai 2010 02:40:00 schrieben Sie: > 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: might be useful to have this a second script. During the last few minutes I put in the size-based removal: http://paste.pocoo.org/show/220213/ using -r would require to remove the unwanted snapshots lateron but it might be worth it because of having it atomic. Regards Christof > > #!/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 -- () ascii ribbon campaign - against html e-mail /\ www.asciiribbon.org - against proprietary attachments