Post by Jim KlimovPost by Harry PutnamI guess a hand rolled scheme for creating snaps (on top of auto-snap)
is more in order... better than messing with a system wide
feature. And something I can readily do.
Would there be any big downside (besides the obvious self maintenance
required) to running a perl script in the background, that creates
snapshots every N minutes, and starts rolling them over (oldest
first) after N or so are present?
This would be only for scripting sessions... so the script would only
be run at the start and stopped at the end.
The snaps would be totally removed periodically, when a new
script[s] was started.
This is also quite an approach.
I am not ready to point at an URL at the moment, but I am certain
there were scripts in some blogs, mail-list archives or perhaps
even on the OI or illumos wikis, that do such rolling in logrotate
style (renumbering the snapshots so that .0 is most recent, etc.)
So yes, this approach also has "a right to be" :)
Also note that if your runtime user has proper permissions to the
dataset (see "zfs allow"), it can create snapshots by just running
:; mkdir $dataset/.zfs/snapshot/$snapname
Alas, removing them is not so easy ("zfs destroy" required), but
at least you can add simple logic into your script to i.e. create
a snapshot before it does something possibly disruptive, or after
completing a chunk of work, etc.
On a side note, question to the list: if an application queues
some asynchronous writes and then a request to make a zfs snapshot,
are there any guarantees that these writes would be committed
(without extra flush()es, sync or lockfs calls) and will become
part of that snapshot? Or is a snapshot a sync operation that may
become committed earlier than the data that was queued before it?
HTH, and thanks for clarifications,
//Jim
-------------------------------------------
illumos-zfs
Archives: https://www.listbox.com/member/archive/182191/=now
RSS Feed: https://www.listbox.com/member/archive/rss/182191/
22398343-302fa0bd
Modify Your Subscription: https://www.listbox.com/
member/?&
Powered by Listbox: http://www.listbox.com
Modify Your Subscription: https://www.listbox.com/member/?member_id=23047029&id_secret=23047029-2e85923f