Closed ams-tschoening closed 2 years ago
Thank you @ams-tschoening for both using my little tool and contributing back! This change makes sense to me, so I'm happy to merge it.
It's great! :-) Have deployed it to multiple Ubuntu based VMs already and am trying it right now for custom backups on Synology NAS. Simply checked out using GIT and things worked OOB. Pretty much following the concepts of zfs-auto-snapshot
and not requiring additional dependencies were the perfect decisions.
I'm using BTRFS formatted USB disk for backup purposes, with multiple subvolumes for different purposes.
btrfs-auto-snapshot
is used to maintain history for each individual purpose. The default implementation doesn't support that use-case because it checks if a given path is a known mounted BTRFS file system. That is not the case, because the given path is a subvolume and that is not mounted by default, but only it's parent.To support my use-case, the check needs to be reversed: Does the given path contain a known BTRFS file system? If so it's a subvolume most likely. In theory this could even be enhanced to check the given path against all known subvolumes for some BTRFS file system, e.g. to prevent accidently providing non-subvolume dirs or alike. Though, doesn't seem to be that important for me.
The reversed check seems to be the only thing I needed to change to support my use-case and in my opinion makes
btrfs-auto-snapshot
more flexible. Using different subvolumes for different purposes is pretty common with BTRFS.My subvolume is in
/volumeUSB1/usbshare/some_child
. That is clearly not contained in the above output. Though, the second line of the above output is contained in my given path, hence the changed search for GREP. That provides everythign we need already:https://linux.die.net/man/1/grep