-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add channel program for taking recursive snapshots based on property #9050
Conversation
8f7b59f
to
e4a87e4
Compare
Added the ability to specify the property as an optional argument |
The So |
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.
This is great, I think having useful example channel programs in contrib will be very helpful.
Would it be worthwhile to consider going one step father and include these examples in the packages? If so, where would be the best place to install them by default? Are there other existing scripts we should consider adding at the same time?
Either way, we'll need to make sure these new files are tracked by the build system. You'll need to add a Makefile.am
to the new zcp
directory, until we determine where these should be installed it can be very simple, just one line should work.
nodist_zcp_SCRIPTS = autosnap.lua
And add the new directory to SUBDIRS
and DIST_SUBDIRS
in contrib/Makefile.am
, and lastly reference the new Makefile
in the top-level configure.ac
. Like so.
diff --git a/configure.ac b/configure.ac
index 9e4f8ff11830..ea8dc872a755 100644
--- a/configure.ac
+++ b/configure.ac
@@ -133,6 +133,7 @@ AC_CONFIG_FILES([
contrib/initramfs/hooks/Makefile
contrib/initramfs/scripts/Makefile
contrib/initramfs/scripts/local-top/Makefile
+ contrib/zcp/Makefile
contrib/pyzfs/Makefile
contrib/pyzfs/setup.py
module/Makefile
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
index 81926a83ee69..9a82f82ee387 100644
--- a/contrib/Makefile.am
+++ b/contrib/Makefile.am
@@ -1,2 +1,2 @@
-SUBDIRS = bash_completion.d dracut initramfs pyzfs
-DIST_SUBDIRS = bash_completion.d dracut initramfs pyzfs
+SUBDIRS = bash_completion.d dracut initramfs pyzfs zcp
+DIST_SUBDIRS = bash_completion.d dracut initramfs pyzfs zcp
contrib/zcp/autosnap.lua
Outdated
end | ||
|
||
noop = false | ||
-- 'noop' is a workaround for issue #9056 |
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.
It'd be nice to include the proposed fix, adding the +
prefix to optstring
from #9056 (comment) so we wouldn't need this workaround. Applying it only to zfs program
for now should minimize any potential compatibility problems.
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.
Should that be included here, or should that fix be it's own PR?
3e53c4c
to
dbcf31f
Compare
@behlendorf thanks to your comments on #9056 I was able to remove the workaround and just document that the program needs to be called with a This makes the argument processing quite a bit simpler and no longer position dependent. The usage is now |
Still struggling to get this to build. Looks like there's something more is need in The TEST builds are failing with |
@clinta sorry about the -zcpdir = $(datarootdir)/zcp
-nodist_zcp_SCRIPTS = autosnap.lua
+EXTRA_DIST = autosnap.lua |
On Wed, Jul 17, 2019 at 05:31:50PM -0700, Brian Behlendorf wrote:
Would it be worthwhile to consider going one step father and include these examples in the packages? If so, where would be the best place to install them by default? Are there other existing scripts we should consider adding at the same time?
in Debian (and derivatives), examples usually go into
/usr/share/doc/<PACKAGE>/examples
that's also where the vdev_id.conf examples are shipped, for example.
maybe a subdir for zcp?
|
Codecov Report
@@ Coverage Diff @@
## master #9050 +/- ##
===========================================
- Coverage 78.67% 66.51% -12.16%
===========================================
Files 400 325 -75
Lines 121009 103708 -17301
===========================================
- Hits 95199 68982 -26217
- Misses 25810 34726 +8916
Continue to review full report at Codecov.
|
Channel programs that many users find useful should be included with zfs in the /contrib directory. This is the first of these contributions. A channel program to recursively take snapshots of datasets with the property com.sun:auto-snapshot=true. Signed-off-by: Clint Armstrong <[email protected]>
I'm looking at some of the zcp tests and I think I should be able to add testing for this program. |
Let's go ahead and add this to |
Channel programs that many users find useful should be included with zfs in the /contrib directory. This is the first of these contributions. A channel program to recursively take snapshots of datasets with the property com.sun:auto-snapshot=true. Reviewed-by: Kash Pande <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Clint Armstrong <[email protected]> Closes openzfs#8443 Closes openzfs#9050
Channel programs that many users find useful should be included with zfs in the /contrib directory. This is the first of these contributions. A channel program to recursively take snapshots of datasets with the property com.sun:auto-snapshot=true. Reviewed-by: Kash Pande <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Clint Armstrong <[email protected]> Closes openzfs#8443 Closes openzfs#9050
Channel programs that many users find useful should be included with zfs in the /contrib directory. This is the first of these contributions. A channel program to recursively take snapshots of datasets with the property com.sun:auto-snapshot=true. Reviewed-by: Kash Pande <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Clint Armstrong <[email protected]> Closes openzfs#8443 Closes openzfs#9050
Channel programs that many users find useful should be included with zfs in the /contrib directory. This is the first of these contributions. A channel program to recursively take snapshots of datasets with the property com.sun:auto-snapshot=true. Reviewed-by: Kash Pande <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Clint Armstrong <[email protected]> Closes openzfs#8443 Closes openzfs#9050
Channel programs that many users find useful should be included with zfs in the /contrib directory. This is the first of these contributions. A channel program to recursively take snapshots of datasets with the property com.sun:auto-snapshot=true. Reviewed-by: Kash Pande <[email protected]> Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Clint Armstrong <[email protected]> Closes #8443 Closes #9050
Motivation and Context
This is a contribution of a channel program that takes recursive snapshots as suggested by @kpande in #8443 .
Description
Creates the directory contrib/zcp where useful community maintained channel programs can kept and starts with a channel program to satisfy the request in #8443.
How Has This Been Tested?
Successfully ran the channel program.
Types of changes
Checklist:
Signed-off-by
.