Package Details: zfs-auto-snapshot-git 1.2.4.r31.92db087-2

Git Clone URL: (read-only, click to copy)
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: xuanruiqi
Last Packager: willemw
Votes: 11
Popularity: 0.008533
First Submitted: 2015-09-03 02:04 (UTC)
Last Updated: 2020-06-13 07:13 (UTC)

Pinned Comments

xuanruiqi commented on 2021-02-21 21:36 (UTC) (edited on 2021-02-21 22:10 (UTC) by xuanruiqi)

In 2021, you probably don't want to use this. zrepl and sanoid are much better choices.

Latest Comments

1 2 Next › Last »

willemw commented on 2021-02-21 22:01 (UTC)

@xuanruiqi: That's good. Still, zfs-auto-snapshot-git is the first on the list. You can pin your comment here, if you want. And I am very surprised that sanoid is not mentioned in the Wiki.

xuanruiqi commented on 2021-02-21 21:54 (UTC)

@willemw: I actually added the section about zrepl on the ZFS page in the Arch Wiki, since that's what I'm using.

willemw commented on 2021-02-21 21:52 (UTC)

@xuanruiqi: Maybe discuss or edit this on the main or discussion page of the ZFS Wiki?

Have switched to sanoid myself.

xuanruiqi commented on 2021-02-21 21:36 (UTC) (edited on 2021-02-21 22:10 (UTC) by xuanruiqi)

In 2021, you probably don't want to use this. zrepl and sanoid are much better choices.

codyps commented on 2020-06-13 23:42 (UTC)

the prefix_label_order patch was intended to make it easier to visually scan the snapshots when they are listed (as the datestamps are all aligned). And it also makes sorting simpler.

It is the case that it's incompatible with samba's vfs shadow copy2 "snapprefix" option. When the prefix_label_order change was added, snapprefix was not an option, and folks supported shadow copy with zfs-auto-snapshot by having the "daily"/"hourly"/etc label pretend to be seconds. See for some solutions folks used.

It is somewhat unfortunate that zfs-auto-snapshot ever used the "daily"/"hourly"/etc labels on snapshots, as it's very feasible (via a bucketing algorithm) to avoid explicit tagging entirely. This is done, for example, in zrepl and snapper (no zfs support mainline in this one).

xuanruiqi commented on 2020-06-13 15:29 (UTC) (edited on 2020-06-13 15:30 (UTC) by xuanruiqi)

I've adopted this package because I recently moved from Btrfs to ZFS. I don't understand the point of the patch either. If anyone has any rationale for the patch, please enlighten me.

willemw commented on 2020-06-13 07:44 (UTC)

Disowned. Not using zfs-auto-snapshot anymore.

fow0ryl commented on 2020-06-12 21:52 (UTC)

What is the real reason for the prefix_label_order.patch?

With this patch a snapshot name is like this: zpool@znap_2020-06-08-2200_daily Without the patch it should be like: zpool@znap_daily_2020-06-08-2200

But using the patched naming scheme breaks support for windows shadow copy in smb! So why there is the patch?

jonathon commented on 2019-04-13 10:27 (UTC) (edited on 2019-04-28 16:57 (UTC) by jonathon)

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 (UTC)

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.)