From dc6f5ddcd9465a62c342cb2b80e56c012061702b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20St=C3=BChmer?= Date: Wed, 16 Apr 2014 13:47:29 +0200 Subject: [PATCH] Fix SNAPNAME to contain the DATE if label is empty When I didn't specify a `--label` on the commandline, the SNAPNAME was missing the $DATE component --- src/zfs-auto-snapshot.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/zfs-auto-snapshot.sh b/src/zfs-auto-snapshot.sh index cd20042..e60a437 100755 --- a/src/zfs-auto-snapshot.sh +++ b/src/zfs-auto-snapshot.sh @@ -507,7 +507,7 @@ SNAPPROP="-o com.sun:auto-snapshot-desc='$opt_event'" DATE=$(date --utc +%F-%H%M) # The snapshot name after the @ symbol. -SNAPNAME="$opt_prefix${opt_label:+$opt_sep$opt_label-$DATE}" +SNAPNAME="$opt_prefix${opt_label:+$opt_sep$opt_label}-$DATE" # The expression for matching old snapshots. -YYYY-MM-DD-HHMM SNAPGLOB="$opt_prefix${opt_label:+?$opt_label}????????????????"