I cant seem to get rsync
to include
with brace expansion properly. Say in my current directory I have three file test.py
, test.sh
and test.html
. I want to transfer only files ending in .py
and .sh
. I tried:
rsync -zrv --include *.{py,sh} --exclude '*' . USER@SERVER:~
But this only transfers the python file. If I swap around the order in the braces to say {sh,py}
then it only transfers the shell script.
Finally, if I do
rsync -zrv --include *.sh --include *.py --exclude '*' . USER@SERVER:~
it transfers both the files all ok. Seems like it doesn't like brace expansion?
--include='*.'{py,sh}
?