Open justinpryzby opened 10 years ago
@justinpryzby, I recall that this behavior is for quirk compatibility with Solaris. If not, then we'll fix it.
I'm pretty sure this behavior is given in some best practices documentation as one reason to keep the top-level rpool
dataset empty. For example:
rpool/
(empty)rpool/dump
rpool/swap
rpool/MyFiles
Where zfs set com.sun:auto-snapshot true rpool/MyFiles
produces the desired behavior.
Thanks for your comment. I guess you mean that rpool is empty, but has sub-filesystems (dump,swap,MyFiles). Setting com.sun:auto-snapshot=true doesn't produce the intended behavior of zfs-auto-snapshot -r rpool, doing a non-recursive snapshot due to the setting of auto-snapshot=false at rpool/swap.
This question doesn't seem answered to me. I am having a similar problem.
zfs-auto-snapshot --recursive --verbose --debug --label=hourly --keep=337 mypool-8tb Debug: Including mypool-8tb for regular snapshot. Doing regular snapshots of mypool-8tb Debug: zfs snapshot -o com.sun:auto-snapshot-desc='-' 'mypool-8tb@zfs-auto-snap_hourly-2015-02-10-0203' @zfs-auto-snap_hourly-2015-02-10-0203, 1 created, 0 destroyed, 0 warnings.
zfs list -t snap mypool-8tb@zfs-auto-snap_hourly-2015-02-10-0203
How the heck am I supposed to run a recursive selective snapshot when setting any childs for exclusions makes the entire recursive snapshot fail? Am I missing something?
I got this answered in irc.
since 0.6.3 'zfs snapshot' accepts many snapshots on the command-line which are done atomically, so this can be solved
The question is does this script support the multiple datasets on the command line, yes it does.
Changing the snapshot command to include the additional datasets works. zfs-auto-snapshot --recursive --verbose --debug --label=hourly --keep=337 mypool-8tb /mypool-8tb/H-Drive
Try calling with //
instead of pool name. Then it works as intended/wanted.
Seems to be a duplicate of #37.
justinp@backup:~$ time sudo ./zfs-auto-snapshot.real -d -s -r -k 32 -l x rpool Debug: Including rpool for regular snapshot. Doing regular snapshots of rpool Debug: zfs snapshot -o com.sun:auto-snapshot-desc='-' 'rpool@zfs-auto-snap_x-2014-02-18-1513' @zfs-auto-snap_x-2014-02-18-1513, 1 created, 0 destroyed, 0 warnings.
justinp@backup:~$ zfs get -H com.sun:auto-snapshot rpool/dump rpool/swap rpool/dump com.sun:auto-snapshot false local rpool/swap com.sun:auto-snapshot false local
The relevant logic that leads to this behavior is commented as:
Exclude datasets that are not named on the command line.
AND,
Check whether the candidate name is a prefix of any excluded dataset name.
Seems if [ -n "$opt_recursive" ], then all CANDIDATES should be included which is a decendent of an argument on the cmdline? [ "${ii#$jj/}" != "$ii" ]