Skip to content

Commit 53ad1dc

Browse files
committed
Merge pull request #15 from tisoft/patch-1
Use only name property for zfs list
2 parents cc9f180 + b6fba51 commit 53ad1dc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/zfs-auto-snapshot.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ ZFS_LIST=$(env LC_ALL=C zfs list -H -t filesystem,volume -s name \
339339
-o name,com.sun:auto-snapshot,com.sun:auto-snapshot:"$opt_label") \
340340
|| { print_log error "zfs list $?: $ZFS_LIST"; exit 136; }
341341

342-
SNAPSHOTS_OLD=$(env LC_ALL=C zfs list -H -t snapshot -S creation -o name) \
342+
SNAPSHOTS_OLD=$(env LC_ALL=C zfs list -H -t snapshot -o name -s name|grep $opt_prefix |awk '{ print substr( $0, length($0) - 14, length($0) ) " " $0}' |sort -r -k1,1 -k2,2|awk '{ print substr( $0, 17, length($0) )}') \
343343
|| { print_log error "zfs list $?: $SNAPSHOTS_OLD"; exit 137; }
344344

345345

0 commit comments

Comments
 (0)