Closed ams-tschoening closed 2 years ago
thanks for the pr @ams-tschoening ! I like making the return codes into vars, and the other logic changes look sane. My only question is does this now require Bash 4 array functionality? If so, that's fine, I just want to document it and we should probably check for it in the code.
can you fix the conflicts @ams-tschoening from me merging #7 first? or does merging that one mean this one is invalid? (sorry about this)
Maybe I'm missing something, but it seems to me that the script only works with the "root" subvolume of each BTRFS mounted file system. Though, I have the use-case of using multiple different subvolumes within the same file system and would like to keep snapshots for all of them automatically. From my understanding, this is exactly how
//
works in my systems using ZFS: Each dataset gets its own snapshots.Therefore I (hopefully :-)) enhanced the script to calculate all subvolumes of all BTRFS file systems, ignore existing snapshots being subvolumes as well, and create snapshots for all of those subvolumes. This included minor changes to what has been merged in #4, how
$keep
is used etc. Things seem to work pretty well for where I deployed the new code.While the change is somewhat incompatible with the former behaviour, I didn't introduce a new option by purpose. I had the feeling you want to follow
zfs-auto-snapshot
and it's default behaviour and its doing exactly the same. If someone needs something different, it shouldn't be too difficult to implement such switch in future.