Package Details: zfs-auto-snapshot-git 1:1.2.4.r0.277287f-1

Git Clone URL: (read-only)
Package Base: zfs-auto-snapshot-git
Description: Implementation of a snapshotting service for ZFS
Upstream URL:
Licenses: GPL2
Conflicts: zfs-auto-snapshot
Provides: zfs-auto-snapshot
Submitter: chungy
Maintainer: chungy
Last Packager: chungy
Votes: 7
Popularity: 0.046375
First Submitted: 2015-09-03 02:04
Last Updated: 2018-02-14 00:27

Latest Comments

jonathon commented on 2019-04-13 10:27

prefix_label_order.patch fails to apply after b0a5909. "Fixed" patch is below though it will need to be checked against the upstream changes to SNAPNAME and SNAPGLOB.

aurweb changes tabs to spaces (and trims trailing whitespace) so this won't work copy&paste. :( An actually-working version is here (for a week, anyway):

diff --git a/src/ b/src/
index 5ef5bae..75ba11d 100755
--- a/src/
+++ b/src/
@@ -398,9 +398,7 @@ if [ -n "$opt_fast_zfs_list" ]
    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) )}') \
+       sort -t'@' -k2r,2 -k1,1) \
      || { print_log error "zfs list $?: $SNAPSHOTS_OLD"; exit 137; }
         SNAPSHOTS_OLD=$(env LC_ALL=C zfs list -H -t snapshot -S creation -o name) \
@@ -569,10 +569,10 @@ SNAPPROP="-o com.sun:auto-snapshot-desc='$opt_event'"
 DATE=$(date --utc +%F-%H%M)

 # The snapshot name after the @ symbol.

 # The expression for matching old snapshots.  -YYYY-MM-DD-HHMM

 if [ -n "$opt_do_snapshots" ]

jgottula commented on 2017-09-18 23:12

Oh good, it looks like my comment did post properly this time. Basically the problem is that the zfs-auto-snapshot utility itself, when in --fast mode, uses some fairly hacky substring-sorting trickery to sort the snapshots by date, and that code was written based on the implicit assumption that the last component of the snap name will be the date+time.

Here's my PKGBUILD diff that applies a patch to fix the sorting:

(I've tested it with the 'PREFIX_DATE_LABEL' modification, but didn't check with the original 'PREFIX-LABEL_DATE' naming, so maybe check into that.)

jgottula commented on 2017-09-18 23:01

Hi. I've discovered that the ArchLinux-specific modification in this PKGBUILD (and also in the PKGBUILD for zfs-auto-snapshot) that changes the snapshot name format from 'PREFIX-LABEL_DATE' to 'PREFIX_DATE_LABEL', while nice, has a big problem: it breaks the sorting of old snapshots when the --fast option is used. Which means that the old-snapshot-deletion feature of the utility will end up destroying snaps that aren't actually the oldest ones! I do have a fix patch if you want it; I tried to comment here before but my comment didn't seem to show up.