-
Notifications
You must be signed in to change notification settings - Fork 1
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
Added the ability for recursive snapshots #1
Conversation
This way we can have multiple subsets of snapshots (e.g. hourly, daily, weekly, etc.).
zfs-snapshotter.bash
Outdated
# Snapshot to take: | ||
SNAP="${DATASET}@$(date "+%Y-%m-%d")${SUFFIX}" | ||
# We dive through all the datasets and just hit those without $AUTOSNAP = false | ||
for DS in `zfs list $DATASET $RECURSIV -H | awk '{ print $1}'`; do |
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 think this could be simplified with zfs list $DATASET $RECURSIV -H -o name
, so awk isn't needed anymore (and we could avoid messing with PATH)
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.
Well... Right. :) I'll change it. In an additional change I added respecting com.sun:auto-snapshot for recursive snapshots. There I used awk too. But there I could also change it.
I'll do it and give a new pull-request (I have no experiance with pull-requests...)
zfs-snapshotter.bash
Outdated
@@ -1,9 +1,12 @@ | |||
#! /usr/bin/env bash | |||
|
|||
PATH=$PATH:/sbin |
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.
Is this because of awk? If so it can probably be removed from line 42 (see my other comment)
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.
No, this was because of debugging I did on my debian machine (having zfs not in PATH). I removed it in a later commit.
Made a new pull request |
With the
-r
option recursive snapshots can be taken. If used with-r
the script respects com.sun:auto-snapshot