jimsalterjrs / sanoid

These are policy-driven snapshot management and replication tools which use OpenZFS for underlying next-gen storage. (Btrfs support plans are shelved unless and until btrfs becomes reliable.)
http://www.openoid.net/products/
GNU General Public License v3.0
3.14k stars 308 forks source link

Syncoid flag "--exclude=" is excluding datasets of similar name #927

Closed wacko37 closed 5 months ago

wacko37 commented 5 months ago

Hi Team/Community,

First off as always thankyou to all involved in making the software a reality.. would be lost without all your hard work

Basically as the title says Sanoid/Syncoid flag "--exclude=" is excluding datasets of similar name ie: I have a dataset called TV-Sonarr and just recently added a 2nd dataset called TV-Sonarr-2

Up until adding the 2nd dataset, Sanoid/Syncoid would exclude TV-Sonarr but since adding the 2nd dataset TV-Sonarr-2 Sanoid/Syncoid now excludes both datasets.

Its almost as if Sanoid/syncoid is only matching the 1st few letters of a dataset and not the exact name.

secabeen commented 5 months ago

Per the documentation, --exclude and --exclude-datasets (among others) take as an argument a "given regular expression". If you wish your regular expression to match an exact name only, you will need to include ^ at the beginning of the string, and $ at the end.

wacko37 commented 5 months ago

Thanks for the speedy reply, so just to clarify I would need to enter "--exclude=^TV-Sonarr$" just to exclude that dataset only?

phreaker0 commented 5 months ago

@wacko37 only if this is your pool name/root dataset, because with ^$ you need to give the full dataset path.

wacko37 commented 5 months ago

Please forgive my lack of knowledge regarding this, Im slightly confused as to how to proceed. I'm using SpaceInvader's script found here:

https://github.com/SpaceinvaderOne/Unraid_ZFS_Dataset_Snapshot_and_Replications

And have edited as per screenshot Screenshot 2024-06-04 161811

But sadly when I ran the script it totally ignored the exclude dataset.

@phreaker0 - Are you saying I need to enter the full path ie:

"--exclude=^/mnt/downloads/Downloads/qBittorrent/Downloads/TV-Sonarr$"

phreaker0 commented 5 months ago

path was the wrong term, you need the full datasaet name if you are doing an exact match, not the mountpoint. like for example 'pool/component/TV-Sonarr'

wacko37 commented 5 months ago

@phreaker0 @secabeen - THANKYOU THANKYOU THANKYOU - this now works perfectly!

Just to clarify for anyone else needing help with this I entered as instructed 'pool/component/TV-Sonarr' which for me meant

"--exclude=^downloads/Downloads/qBittorrent/Downloads/TV-Sonarr$"