~woffs/zerbst

fd3aa64b1b97aa37ce7f961476b718ea6d06bb3b — Frank Doepper 1 year, 10 months ago 6533c11
try to create zfs dataset if directory does not yet exist
1 files changed, 9 insertions(+), 0 deletions(-)

M zerbst-suck-rsync
M zerbst-suck-rsync => zerbst-suck-rsync +9 -0
@@ 74,6 74,15 @@ do
      pfx=".zerbst/$(printf '%06d\n' $n)$host"
      : > "$pfx.cmds"
      : > "$pfx.filter"
      # try to create zfs dataset if dir does not yet exist
      if ! [ -d "$host" ]
      then
        pool=$(df -t zfs . | tail -1 | cut -d\  -f1 | cut -d/ -f1)
        if [ "$pool" ] && zpool list -Honame "$pool" >/dev/null
        then
          zfs create "$pool/$host"
        fi
      fi
    ;;
    /*) # path
      [ "$pfx" ] || continue