Draft: Add ability to backup recursively #73
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add a flag to enable recursive backup, effectively uploading nested chilren filesystems recursively (being ZFS datasets and volumes).
Follows the late feature request #65.
I’m opening this draft to collect early reviews and suggestions. I’m especially interested in reviews regarding the coding style and implementation logic :-)
TODO
list_children(filesystem)
Typical use cases
I require the feature as I use Docker’s ZFS storage driver leading me to 300+ ZFS datasets I’d like to snapshot, on top of the base hundred I have on my pool.
Open questions
Those are questions this new feature raise, and feature ideas that might come up in future PRs. I’m wondering if those are really useful, if they get decent alternatives, and/or if they’re worth the extra complexity.
1. Should a removed filesystem (e.g. a removed Docker volume) lead to garbage collection on the remote backup storage?
It might be great to get a command such as
zfsup cleanup -f
removing old and locally removed filesystems as a cron schedule for instance. Might be useful in some very specific cases.2. Should we add an
except
option to pick recursively all filesystems but a few ones?I’m thinking of a recursive backup of all datasets but a few ones, such as temporary files or big datasets (e.g. for datasets such as
/tmp
and games someone don’t wish to backup, but would like to backup every other ones). Without the except feature, I believe that would prevent from using a higher-level recursive backups there.