Modify service property in Solaris

This is nothing too exciting but it is something that I seem to alvais forget. So I am hoping that by writing it down once I might have a better chance to remember. Or at least remember where to look for pointers next time.

I was fiddling with ZFS auto-snapshots on a server. They were set up so that a daily snapshot was being kept for a month and I simply wanted to reduce that time to a week. I knew that this is set up through svc properties and could see this like this

bl3:~# svcprop auto-snapshot:daily
zfs/auto-include boolean true
zfs/avoidscrub boolean false
zfs/backup astring none
zfs/backup-lock astring unlocked
zfs/backup-save-cmd astring not\ set
zfs/fs-name astring //
zfs/interval astring days
zfs/label astring daily
zfs/offset astring 0
zfs/period astring 1
zfs/sep astring _
zfs/keep astring 31
zfs/snapshot-children boolean false
zfs/verbose boolean true
general/action_authorization astring solaris.smf.manage.zfs-auto-snapshot
general/value_authorization astring solaris.smf.manage.zfs-auto-snapshot
general/enabled boolean true

I knew I had to modify the zfs/keep parameter but I just could not remember how to modify these properties through svccfg. After 5 minutes of googling I found this nice summary and was able to put the pieces and syntax together:

bl3:~# svccfg -s auto-snapshot:daily
svc:/system/filesystem/zfs/auto-snapshot:daily> setprop zfs/keep=7
svc:/system/filesystem/zfs/auto-snapshot:daily> exit
bl3:~# svcadm refresh auto-snapshot:daily

Now I can only hope I remember the ‘-s’ flag to svccfg and setprop.

Leave a Reply

Your email address will not be published. Required fields are marked *