I've created a simple test directory:
├── backup.tgz
├── Dummy-dir
│ ├── dummy-file-a.txt
│ ├── dummy-file-b.txt
│ ├── Images
│ │ ├── imgA.jpg
│ │ ├── imgB.jpg
│ ├── Music
│ │ ├── Una Mattina - ludovico Einaudi (Jimmy Sax Impro live).mp3
│ │ └── Worakls - Blue ( Jimmy Sax live).mp3
│ └── Videos
│ ├── IMG_0001.MOV
│ └── IMG_5377.mov
├── Dummy-target
├── excludes.txt
To test, i did rsync of Dummy-dir to Dummy-target.
I ran multiple tests:
rsync -avz --exclude ./Dummy-dir/Images ./Dummy-dir/ ./Dummy-target/
rsync -avz --exclude=./Dummy-dir/Images ./Dummy-dir/ ./Dummy-target/
rsync -avz --exclude-from=./excludes.txt ./Dummy-dir/ ./Dummy-target/
I tested both with relative and full path.
No matter what i try, it doesn't seems to work.
What is going on?
This should exclude Images folder:
rsync -avz --exclude 'Images' ./Dummy-dir/ ./Dummy-target/
should be relative to the source path without the source path
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With