The proper way to use the dsync with -X argument is as follows
dsync -X "Exclusion1" [-X "Exclusion2"] ORIG DEST
Where the Exclusions are wildcarded, for example /D/Folder/* would exlude all FILES inside "/D/Folder", if you want to exclude all the folders inside /D/Folder, you need to end the exclusion string with a "/" --> /D/Folder/*/
If you want to exclude only a folder you would use -X /D/Folder/
Same syntax for the Include (-I) arguments
Hope this helps!
For your specific case it would go:
dsync -X "/D/FolderToCopy/FolderExclude1/" -X "/D/FolderToCopy/FolderExclude2/" //Host1/D/FolderToCopy //Host2/Destination
1 of 1 people found this helpful
Sorry, my bad, you don't need to specify the full path to the directories to exclude, they need to be relative to the folder you want to syncronize
dsync -X "/FolderExclude1/" -X "/FolderExclude2/" //Host1/D/FolderToCopy //Host2/Destination
Interesting. Okay, this is working using the exact syntax that you used. But when I did use the absolute path, it stopped working. Is it not possible to use an absolute path?
dsync -dmo -X
properly excluded FolderExclude1 but copied FolderExclude2 and its contents
I believe the excluded paths are computed relatively to the folder to be copied, thus if you include the full path it would mean to try to exclude
which doesn't exist ...
Aha! Yes, that appears to be the key. So I can give a precise directory so long as I work relative to the folder specified for copying.
So for example, to exclude:
It worked to use:
The result was that /tmp/dsync_test/full/path was properly copied, and FolderExclude2 was properly excluded