I'm using rsync to copy some files from a share to another.
Recursively, I need to:
- Delete files at destination that were removed from the origin
- Only sync php and js files
- Exclude every other file type
- Do not delete
.svn/
directories at destination
If I use this:
rsync -zavC --delete --include='*.php' --include='*.js' --exclude="*" \
/origiin /destination
Then rsync is not recursive because exclude="*"
excludes all files but also folders
If I add --include="*/"
then the .svn/
directory gets deleted (it also gets included)
How can I solve this mind blasting dilemma?
uname -a:
Linux tux 3.9.2-1-ARCH #1 SMP PREEMPT Sat May 11 20:31:08 CEST 2013 x86_64 GNU/Linux
rsync version:
rsync 3.0.9-6
Thanks in advance