Quote Originally Posted by pbiel View Post
Hi geekos! And a happy new year to all of you!

I'm having a bit of a trouble with rsync. A working command I use for remote back-ups is this one:
Code:
rsync -razP --exclude={'*.git*','*.argh'} ./Data/ bar@foo.online:/home/42/precious_data
However, my plan was to have this as a (re-useable) shell script. And so I went and created this script:
Code:
options="-razP --exclude={'*.git*','*.argh'} --delete"
local_dir="./Data/"
remote_dir="bar@foo.online:/home/42/precious_data"

rsync ${options} ${local_dir} ${remote_dir}
It kind-of-works. However, all files (including those I nick-named 'argh' here), will also be copied. That's huge binary files I don't want to have!

Small aberrations, such as using \{…\} or *.argh* did not work. Even the seemingly straight-forward "--exclude *.git* --exclude *.argh" failed. I'm a bit puzzled by now.

Does anyone of you see the (probably stupid) mistake I made here?
"You can also exclude multiple paths within curly braces": https://askubuntu.com/questions/3204...ies-with-rsync

I tried "rsync --exclude={.xauth*,dup*} .". It obviously does what I expect.