Harry Putnam
2009-Apr-15 21:59 UTC
[zfs-discuss] What can I do to shorten the long awkward names of snapshots?
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. I find these long names awkward to deal with. Like when ssh''d in and in a console terminal, if you run a long ls, those names are going to wrap and become confusing to look at for no good reason. Where can I adjust this naming mechanism... including date.. maybe a separate mechanism.
Tim Foster
2009-Apr-15 22:20 UTC
[zfs-discuss] What can I do to shorten the long awkward names of snapshots?
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: timf at 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
Harry Putnam
2009-Apr-15 22:33 UTC
[zfs-discuss] What can I do to shorten the long awkward names of snapshots?
Tim Foster <Tim.Foster at Sun.COM> writes:> > Hope this helps,Yes and a good bunch of info there... thanks. Looks way to complicated just sooth line wrapping in some circumstances. Thanks for the walk thru though.
Andre van Eyssen
2009-Apr-16 00:32 UTC
[zfs-discuss] What can I do to shorten the long awkward names of snapshots?
On Wed, 15 Apr 2009, Harry Putnam wrote:> Would become: > a:freq-041509_1630Can I suggest perhaps something inspired by the old convention for DNS serials, along the lines of fyyyymmddtt? Like: a:f200904151630 This makes things easier to sort and lines up in a tidy manner. -- Andre van Eyssen. mail: andre at purplecow.org jabber: andre at interact.purplecow.org purplecow.org: UNIX for the masses http://www2.purplecow.org purplecow.org: PCOWpix http://pix.purplecow.org
Blake
2009-Apr-16 19:35 UTC
[zfs-discuss] What can I do to shorten the long awkward names of snapshots?
The cool thing about the way Tim has built the service is that you can edit the variable values in the method script to make snapshot titles pretty much whatever you want. I think he made a good compromise choice between simplicity and clarity in the current titling system. Remember that the Time Slider snapshot viewer essentially makes this transparent to a the end user. And you can make use of Time Slider remotely using ssh -X hostname and then nautilus --no-desktop. On Wed, Apr 15, 2009 at 8:32 PM, Andre van Eyssen <andre at purplecow.org> wrote:> On Wed, 15 Apr 2009, Harry Putnam wrote: > > >> Would become: >> ?a:freq-041509_1630 > > Can I suggest perhaps something inspired by the old convention for DNS > serials, along the lines of fyyyymmddtt? Like: > > a:f200904151630 > > This makes things easier to sort and lines up in a tidy manner. > > > -- > Andre van Eyssen. > mail: andre at purplecow.org ? ? ? ? ?jabber: andre at interact.purplecow.org > purplecow.org: UNIX for the masses http://www2.purplecow.org > purplecow.org: PCOWpix ? ? ? ? ? ? http://pix.purplecow.org > > _______________________________________________ > zfs-discuss mailing list > zfs-discuss at opensolaris.org > http://mail.opensolaris.org/mailman/listinfo/zfs-discuss >