From owner-freebsd-stable@FreeBSD.ORG Sun May 30 21:53:12 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 62DAD1065676 for ; Sun, 30 May 2010 21:53:12 +0000 (UTC) (envelope-from kirk@strauser.com) Received: from kanga.honeypot.net (kanga.honeypot.net [IPv6:2001:470:a80a:1:21f:d0ff:fe22:b8a8]) by mx1.freebsd.org (Postfix) with ESMTP id 240118FC0A for ; Sun, 30 May 2010 21:53:11 +0000 (UTC) Received: from kanga.honeypot.net (localhost [127.0.0.1]) by kanga.honeypot.net (Postfix) with ESMTP id E3B4E7BCDB; Sun, 30 May 2010 16:53:10 -0500 (CDT) X-Virus-Scanned: amavisd-new at honeypot.net Received: from kanga.honeypot.net ([127.0.0.1]) by kanga.honeypot.net (kanga.honeypot.net [127.0.0.1]) (amavisd-new, port 10024) with LMTP id cXkvb+QdjXFd; Sun, 30 May 2010 16:53:08 -0500 (CDT) Received: from pooh.honeypot.net (pooh.honeypot.net [IPv6:2001:470:a80a:1:20a:95ff:fed5:10f2]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by kanga.honeypot.net (Postfix) with ESMTPSA id 985357BCD0; Sun, 30 May 2010 16:53:07 -0500 (CDT) Message-Id: <4F444333-C839-4C2F-AA5D-1898192DDE93@strauser.com> From: Kirk Strauser To: Denny Lin In-Reply-To: <20100529234507.GD20695@mail.hs.ntnu.edu.tw> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Date: Sun, 30 May 2010 16:53:06 -0500 References: <4C017419.9010909@strauser.com> <20100529234507.GD20695@mail.hs.ntnu.edu.tw> X-Mailer: Apple Mail (2.936) Cc: FreeBSD-STABLE Mailing List 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: Sun, 30 May 2010 21:53:12 -0000 On May 29, 2010, at 6:45 PM, Denny Lin wrote: > How about writing a shell script with this functionality? Get the > available disk space using: > $ zfs list -H -o avail tank > > And then compare the figures against a limit. Then delete the oldest > snapshots when the limit is exceeded. That's certainly an option, and easy to implement in a shell script. It just wouldn't work in the case where a bunch of data comes in between runs of that script, and that's why I wanted something lower- level. -- Kirk Strauser