Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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 '14 at 12:05

You must log in to answer this question.

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