bolthole / zrep

ZREP ZFS based replication and failover script from bolthole.com
Other
248 stars 57 forks source link

Allow `-R` to be passed *after* other global flags (`-t` and `-D`) #196

Open janvrany opened 1 year ago

janvrany commented 1 year ago

Using custom tags and a recursive refresh fails when creating snapshot with error:

ERROR: unrecognized zrep subcommand -R

This is because it executes something like

ssh  source_host zrep -t zrep_tag -R snaponly fs

The -R flag comes after -t flag. However, zrep (prior this commit) required -R to be the fist flag.

This commit moves the check for -R flag and initialization of ZREP_R to the same loop that checks for other global flags (currently -t and -D). This fixes the issue.