From owner-freebsd-fs@FreeBSD.ORG Mon Jun 6 19:06:09 2011 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 79A32106566C for ; Mon, 6 Jun 2011 19:06:09 +0000 (UTC) (envelope-from a.smith@ukgrid.net) Received: from mx0.ukgrid.net (mx0.ukgrid.net [89.21.28.41]) by mx1.freebsd.org (Postfix) with ESMTP id 3E54E8FC0C for ; Mon, 6 Jun 2011 19:06:08 +0000 (UTC) Received: from [89.21.28.38] (port=46390 helo=omicron.ukgrid.net) by mx0.ukgrid.net with esmtp (Exim 4.74; FreeBSD) envelope-from a.smith@ukgrid.net envelope-to freebsd-fs@freebsd.org id 1QTf7m-000H6Y-Ff; Mon, 06 Jun 2011 20:06:06 +0100 Received: from 80.174.147.221.dyn.user.ono.com (80.174.147.221.dyn.user.ono.com [80.174.147.221]) by webmail2.ukgrid.net (Horde Framework) with HTTP; Mon, 06 Jun 2011 20:06:06 +0100 Message-ID: <20110606200606.137964cbuj8m1b40@webmail2.ukgrid.net> Date: Mon, 06 Jun 2011 20:06:06 +0100 From: a.smith@ukgrid.net To: freebsd-fs@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; DelSp="Yes"; format="flowed" Content-Disposition: inline Content-Transfer-Encoding: 7bit User-Agent: Internet Messaging Program (IMP) H3 (4.3.9) / FreeBSD-8.1 Subject: RE: zfs snapshot management X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Jun 2011 19:06:09 -0000 Hi Charles, I have written some Bash scripts that manage my snapshots via crontab and can also replicate the snapshots to a remote server via Ssh. The scripts do: *Run snapshot, (can be once a day, once an hour etc to meet system requirements). Snapshot type is weekly if run at 00h on Sunday, Monthly if run at 00h on the first of the monthly, otherwise is "regular" snapshot. *Regular snapshots are deleted after X weeks (X configurable as command argument) *Weekly snapshots are deleted after 1 year *Monthly snapshots are never automatically removed *Weekly and Monthly snapshots are optional, ie used if defined by command arguments. *If replication is used data is sent via Ssh, either directly piped into zfs receive or sent as a file which can be read in via another script at a later date (useful if you are paranoid and want the secondary ZFS to be some hours behind the primary). *Data is sent via non-root user for security. User must be given the relevant ZFS privileges. *Snapshots are pruned on both source and destination servers. I haven't published the scripts as I haven't put all the polish onto them that I think they would need. But they work as described above and are reliable, I can pass you a copy if they are of interest, cheer Andy.