I have created a script that gets a snapshot and backs the snapshot to tape. I would like to keep the snapshot around for one week, than destroy it using the following command: "zfs destroy snapshotlvolume." Is there a way to automate the destroying of snapshots that are older that x amount of days? This message and its attachments may contain legally privileged or confidential information. It is intended solely for the named addressee. If you are not the addressee indicated in this message (or responsible for delivery of the message to the addressee), you may not copy or deliver this message or its attachments to anyone. Rather, you should permanently delete this message and its attachments and kindly notify the sender by reply e-mail. Any content of this message and its attachments that does not relate to the official business of News America Incorporated or its subsidiaries must be taken not to have been sent or endorsed by any of them. No warranty is made that the e-mail or attachment(s) are free from computer virus or other defect. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.opensolaris.org/pipermail/zfs-discuss/attachments/20070913/23457897/attachment.html>
Hi Joe, On Thu, 2007-09-13 at 11:39 -0400, Poulos, Joe wrote:> Is there a way to automate the destroying of snapshots that are older > that x amount of days? >Yeah, a few people have done stuff like this. Chris has this: http://blogs.sun.com/chrisg/entry/a_faster_zfs_snapshot_massacre and I''ve another one that will also do this for you: http://blogs.sun.com/timf/entry/zfs_automatic_snapshots_0_8 I''m sure there''s other scripts floating around, which may be more suited to your requirements but these are a start at least. cheers, tim -- Tim Foster, Sun Microsystems Inc, Solaris Engineering Ops http://blogs.sun.com/timf
Tim Foster wrote:> Hi Joe, > > On Thu, 2007-09-13 at 11:39 -0400, Poulos, Joe wrote: >> Is there a way to automate the destroying of snapshots that are older >> that x amount of days? >> > Yeah, a few people have done stuff like this. > > Chris has this: > http://blogs.sun.com/chrisg/entry/a_faster_zfs_snapshot_massacre > > and I''ve another one that will also do this for you: > http://blogs.sun.com/timf/entry/zfs_automatic_snapshots_0_8 > > I''m sure there''s other scripts floating around, which may be more suited > to your requirements but these are a start at least.I wrote one that whacks Sun-Fri snapshots for a given month. Afterwards, it goes through and whacks zero-sized snapshots (i.e. nothing changed that week). While I could probably just cron it, I am paranoid enough to run it manually when I see the vpool filling up. :) If anyone is interested, it is ftp://ftp.warthog.com/pub/warthog/Solaris/cleanzfs.ksh Rob++ -- Internet: windsor at warthog.com __o Life: Rob at Carrollton.Texas.USA.Earth _`\<,_ (_)/ (_) "They couldn''t hit an elephant at this distance." -- Major General John Sedgwick