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 using the following command to synch files from one folder to another on my local OSX system:

rsync -avC ./src ~/Sites

Inside of ./src there are several sub-folders:

  • ./src/assets
  • ./src/core
  • ./src/css
  • ./src/js

All folders and content are copied as expected, except for ./src/core. Renaming the folder resolves the problem, but isn't an option. For example, named as ./src/core2 and it works.

share|improve this question

1 Answer 1

It does that because you asked it to. Specifically, you asked with -C that it "ignore things like CVS does".

That includes various junk like core dumps that are not really interesting at the far side of the link. Except it does that by name rather than "type and name", so your directory gets caught in the mix.

From rsync(1), the list of what it excludes:

RCS  SCCS CVS CVS.adm RCSLOG cvslog.* tags TAGS .make.state .nse_depinfo *~ #*
.#* ,* _$* *$ *.old *.bak *.BAK *.orig *.rej .del-* *.a *.olb *.o  *.obj  *.so
*.exe *.Z *.elc *.ln core .svn/ .git/ .hg/ .bzr/

To ignore files and folders from CVS and include the "core" folder, explicitly include "core" like so:

rsync -avC --include "core" ./src ~/Sites
share|improve this answer
    
Ah, I need it to ignore .svn stuff, but not a folder named "core" Overlooked core in that list. Thank you. –  Michael Prescott Feb 10 '12 at 5:01
    
Can I do both? First, exclude all that, but then include just my "core" –  Michael Prescott Feb 10 '12 at 5:03
    
I think an explicit include will override the exclude. Give it a shot. –  Daniel Pittman Feb 10 '12 at 5:06
    
Yes, the solution: rsync -avC --include "core" ./src ~/Sites –  Michael Prescott Feb 10 '12 at 5:19
    
Also, rsync respects the ignore list in .cvsignore. –  Janis Feb 3 at 12:05

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.