Hi Harry,

On Wed, 2009-04-15 at 16:59 -0500, Harry Putnam wrote:
> How can I make zfs give some shorter kind of names to the auto snapshots
> it takes.
> 
> I'd like to alter the date string and shorten like this:
> 
>   zfs-auto-snap:frequent-2009-04-15-16:30

> Would become:
>   a:freq-041509_1630
> 
> That's less than 1/2 the 40 characters the auto process generates.

If you want to change it, you'll need to edit some hardcoded values in
the method script and tweak a few SMF values.

In /lib/svc/method/zfs-auto-snapshot, change

* the $PREFIX variable
* the $SEP variable
* the $DATE variable

and in the various SMF instances, change the "zfs/label" property, eg:

t...@igyo[72] svcprop -p zfs/label auto-snapshot
svc:/system/filesystem/zfs/auto-snapshot:weekly/:properties/zfs/label astring 
weekly
svc:/system/filesystem/zfs/auto-snapshot:monthly/:properties/zfs/label astring 
monthly
svc:/system/filesystem/zfs/auto-snapshot:hourly/:properties/zfs/label astring 
hourly
svc:/system/filesystem/zfs/auto-snapshot:frequent/:properties/zfs/label astring 
frequent
svc:/system/filesystem/zfs/auto-snapshot:daily/:properties/zfs/label astring 
daily

I'm not 100% sure what would happen on upgrade if you change the method
script, so that might be worth keeping in mind should you choose to do
that.

It's worth pointing out, that should you choose a pattern that happens
to match an existing snapshot, that snapshot is liable to be destroyed
when the service recycles old snapshots, so take care!

[ we could potentially fix that, now that snapshots have their own
user-properties, by adding a user-property to every auto-snapshot that
was taken, and taking care to only destroy those ones, but we're not
there yet ]

Hope this helps,

        cheers,
                        tim

_______________________________________________
zfs-discuss mailing list
zfs-discuss@opensolaris.org
http://mail.opensolaris.org/mailman/listinfo/zfs-discuss

Reply via email to