0

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?

1
  • Have you tried --include='*.'{py,sh} ?
    – Jonno
    Aug 1, 2017 at 9:27

1 Answer 1

1

I suspect the shell isn't quite interpreting it correctly, use the following notation to supply multiple extensions:

--include='*.'{py,sh}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .