Skip to content
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

Closed
wants to merge 6 commits into from

Conversation

rakor
Copy link

@rakor rakor commented Feb 6, 2023

With the -r option recursive snapshots can be taken. If used with -r the script respects com.sun:auto-snapshot

# 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
Copy link
Owner

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)

Copy link
Author

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

@@ -1,9 +1,12 @@
#! /usr/bin/env bash

PATH=$PATH:/sbin
Copy link
Owner

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)

Copy link
Author

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.

@rakor rakor closed this Feb 9, 2023
@rakor
Copy link
Author

rakor commented Feb 9, 2023

Made a new pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants