I am trying to copy a folder and excluding two subdirectories, but rsync keeps copying the directories in the exclude.
rsync -savzPh -e "ssh -p 237" --include '*/' --include '*.pdf' --include '*.PDF' --exclude '*' --exclude 'a1' --exclude 'my archive2' user@ip:"/home/path/my folder" .
Source looks like this:
- /home/path/my folder/folder1
- /home/path/my folder/folder2
- /home/path/my folder/a1
- /home/path/my folder/a2
- /home/path/my folder/my archive
- /home/path/my folder/my archive2
The pdf files in folders in exclude argument are still are getting copied.
Do you have any idea what I am doing wrong?