On Tue, Jun 13, 2006 at 01:43:08PM -0700, Matthew Ahrens wrote:
> On Mon, Jun 12, 2006 at 12:58:17PM +0200, Robert Milkowski wrote:
> >   I'm writing a script to do automatically snapshots and destroy old
> >   one. I think it would be great to add to zfs destroy another option
> >   so only snapshots can be destroyed. Something like:
> > 
> >      zfs destroy -s SNAPSHOT
> > 
> >      so if something other than snapshot is provided as an argument
> >      zfs destroy wouldn't actually destroy it.
> >      That way it would be much safer to write scripts.
> > 
> >      What do you think?
> 
> I think that you shouldn't run commands that you don't want run.  If you
> need some safeguards while developing a script, you can always write a
> wrapper script around zfs(1m).

Alternatively, you could just make sure your argument always has a '@' in
it:

        zfs destroy -s [EMAIL PROTECTED]

Cheers,
- jonathan

> However, 'zfs destroy <fs>' will fail if the filesystem has snapshots
> (presumably most will, if your intent is to destroy a snapshot), which
> provides you with some safeguards.
> 
> --matt
> _______________________________________________
> zfs-discuss mailing list
> zfs-discuss@opensolaris.org
> http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

-- 
Jonathan Adams, Solaris Kernel Development
_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to