DarkMatter in Cyberspace
  • Home
  • Categories
  • Tags
  • Archives

Rsync Omit "core" Folder


Problem Description

Test script:

mkdir {gsp,dst,dst2,dst3} 
svn co http://10.0.2.59:8118/svn/gsp/Development-Area/3-SCL/Trunk/TaskServer_Gsp gsp
rsync -auC gsp/* dst/
rsync -au gsp/* dst2/
rsync -auC --include=core gsp/ dst3/
rsync -au gsp/ dst4/
diff -rq gsp dst

Output:

Only in gsp/com.boco.gdpp.taskserver.core/src/com/boco/gdpp/taskserver: core

Cause and Solution

The -C option looks "core" as a source version control folder, and exclude it. See man page for details.

The size of the ".svn" folder is similar to the host folder. So "-C" option is necessary. Becase ".svn" is not "", so there is no ".svn" in dst2. But it will also exclude other "." folder in gsp. So the right answer is:

rsync -auC --include=core gsp/ dst3/

The dst4 is a completely copy.



Published

Nov 28, 2013

Last Updated

Nov 28, 2013

Category

Tech

Tags

  • linux 158
  • rsync 1
  • shell 46

Contact

  • Powered by Pelican. Theme: Elegant by Talha Mansoor