I want to sync all *.sh files in exactly one sub directory. I tried this cmd but all files in a directory are synced instead of only particular file types.
rsync -vr -n --include="*.sh" --exclude="*/*/" --prune-empty-dirs /source /target
I also tried adding a filter like
but this did not change the result. Another filter
rsync -vr -n --include="*.sh" --filter="-! *.sh" --exclude="*/*/" --prune-empty-dirs
gives me an empty list. If I exclude "*" I also exclude "*.sh"... What is wrong? Thanks!
The depth should be one - the name of the subdirectory is not known. For example,
home/subdirectory1/subsubdirectory/subsubsubdirectory/file.sh home/subdirectory1/file1.sh home/subdirectory2/file2.sh home/subdirectory3/file
In the above example
rsync should start in home, sync directory hierarchy and only the files