zfsonlinux / zfs-auto-snapshot

ZFS Automatic Snapshot Service for Linux
GNU General Public License v2.0
848 stars 244 forks source link

problem when specifying dataset #32

Open mribbons opened 9 years ago

mribbons commented 9 years ago

https://github.com/zfsonlinux/zfs-auto-snapshot/blob/master/src/zfs-auto-snapshot.sh#L392

This line doesn't seem to work, I always get "0 created"

# zfs-auto-snapshot --syslog --label=hourly --keep=24 --label=test tank/data
@zfs-auto-snap_test-2014-09-15-0554, 0 created, 0 destroyed, 0 warnings.

However if I change it to awk -F$'\t' .... it works.

Can I submit a PR or is my shell knowledge far too limited?

dajhorn commented 9 years ago

@mribbons, thanks for the bug report. (I visit this repo infrequently, and just noticed this issue ticket.)

This is probably an implementation quirk. I will check it against GNU Awk 4.1 and Busysbox 1.22 later, which are my deployment targets. Which version of awk is glitching for you?

The -F$'\t' is a bashism, which makes it inappropriate for this script. If a literal tab character is a fix, then the general solution will look like -F$(printf '\t').

mribbons commented 9 years ago

@dajhorn hi, I hope this is sufficient. GNU Awk 4.0.1 Linux hostname 3.13.0-36-generic #63-Ubuntu SMP Wed Sep 3 21:30:07 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

dajhorn commented 9 years ago

@mribbons, I have the same version on my Ubuntu computer, but I'm not able to reproduce the glitch. I will revisit this issue ticket later.