-
Notifications
You must be signed in to change notification settings - Fork 255
Remove 'label' (eg frequent/hourly/daily etc) from snapshot name and place in snapshot property #22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Remove 'label' from snapshot name and place in a snapshot property
Fixed the --fast option. |
@@ -347,10 +352,10 @@ ZFS_LIST=$(env LC_ALL=C zfs list -H -t filesystem,volume -s name \ | |||
|
|||
if [ -n "$opt_fast_zfs_list" ] | |||
then | |||
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) )}') \ | |||
SNAPSHOTS_OLD=$(env LC_ALL=C zfs list -H -t snapshot -o com.sun:auto-snapshot-label,name -s name|grep $opt_prefix |awk '{ print substr( $0, length($0) - 14, length($0) ) " " $0}' |sort -r -k1,1 -k3,2|awk '{ print substr( $0, 17, length($0) )}') \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
produce the listing with label first, then name, so the awk/sort stuff works correctly
@leecallen, thanks. I will look at this when Trusty goes into beta in a few weeks. |
@leecallen, I merged this pull request into a topic branch for testing. This script is dash-compatible by design, so I need to think about the |
@@ -186,7 +191,7 @@ do_snapshots () # properties, flags, snapname, oldglob, [targets...] | |||
fi | |||
fi | |||
fi | |||
done | |||
done <<< "$SNAPSHOTS_OLD" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Debian Wheezy this line gives me a Syntax error: redirection unexpected
. The dash
shell does not have the <<<
operator: http://stackoverflow.com/a/2462357/2728336
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The quick workaround for me was to define bash as the specific shell: #!/bin/sh
-> #!/bin/bash
. This might affect Ubuntu also.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've merged @leecallen as per instructions on the wiki and I've changed to /bin/bash but now I'm getting echoed the error "The filesystem argument list is empty." (line 350 is the print)
I'm on Debian 8.8. I've installed via "make install" because after the merge with leecallen it fails to build the deb package
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, when running zfs-auto-snapshot using bash without arguments, I did get the error that you mention ("The filesystem argument list is empty"). However, when running it with the correct arguments, it worked fine. I used the following arguments:
bash ./zfs-auto-snapshot --quiet --syslog --label=frequent --keep=4 //
Yes that's an ugly bit of code. I am not sure I ever explained the reason for these changes. I am using Lee On Wed, Apr 16, 2014 at 4:20 PM, Darik Horn [email protected]:
Lee Allen |
Hi, please explain: how to setup properly zfs-auto-snapshot for windows? Thanks |
Hello Janos, "fixing the conflict" means looking at the file (after having completed the steps listed before) using a text editor and fixing the problem which is marked by the marker An explanation is e.g. here: http://genomewiki.ucsc.edu/index.php/Resolving_merge_conflicts_in_Git paragraph How do I find conflicts within the file itself? and the next paragraph. |
Any chance this can get updated for latest master? |
Hi, thanks for the work that you've done on this before. If you're still interested, please submit a renewed patch against master since master has diverged too much already in the last few years. This upstream project has been dead for a while and I'm trying to revive it, so all input is appreciated. |
@beren12 you won't need special snapshot names for Samba starting with Samba 4.6.2 which became more flexible. See https://github.com/zfsonlinux/zfs-auto-snapshot/wiki/Samba 'Update: Starting with Samba 4.6.2 [...]` |
Re: issue #10 "Integrate shadow copy snapshots for Samba"
Remove 'label' from snapshot name and place in a snapshot property.
This change breaks the --fast option. It may be possible to preserve that feature but it's beyond my scripting skills.