Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm building a shell script and at some point I'm excecuting thie command :

rsync -arv --delete --exclude=".svn,*.db,.DS_Store" Source/ Dest/

However it seems the my exclusion doesn't work. Am I doing something wrong? With a direct command in terminal it works. Perhaps the problem comes from " "

share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

Perhaps the problem comes from " "

The shell expands metacharacters in doubly-quoted strings and then passes the reult to the actual command (it's actually more complicated than this)

Try using single quotes.

--exclude=".svn,*.db,.DS_Store"

Are you sure the PATTERN in -exclude=PATTERN can be a comma-separated list? I'd try splitting it into multiple -exclude options

share|improve this answer
    
splitting is the good solution : --exclude=./svn --exclude=*.db ... Thx ! –  Pierre Dec 6 '12 at 21:38
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.