2013-11-28 63 views
1

當我備份與下面的腳本本地文件夾,子文件夾「芯」被省略:rsync的本地備份過程中丟失的文件夾

mkdir {gsp,dst} 
svn co http://10.0.2.59:8118/svn/gsp/Development-Area/3-SCL/Trunk/TaskServer_Gsp gsp 
rsync -auC gsp/* dst/ 
diff -rq gsp dst 

輸出是:

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

返回值的rsync命令是0,這意味着沒有錯誤。以下是文件夾「gsp」和「dst」的結構,「核心」不是最深的子文件夾。爲什麼「核心」不能被複制到「dst」?

tree -d gsp 

gsp 
|-- com.boco.gdpp.taskserver.core 
| |-- lib 
| |-- META-INF 
| | `-- spring 
| `-- src 
|  `-- com 
|   `-- boco 
|    `-- gdpp 
|     `-- taskserver 
|      |-- config 
|      | `-- exports 
|      |  `-- exceptions 
|      |-- core 
|      | |-- changenode 
|      | | |-- element 
|      | | `-- process 
|      | `-- task 
|      |  `-- util 
|      |-- export 
|      | |-- bean 
|      | | |-- enums 
|      | | `-- processdef 
|      | `-- util 
|      |  `-- processtree 
|      `-- msg 
|       `-- support 
|-- com.boco.gdpp.taskserver.gsp.gworkflow 
| |-- libs 
| |-- META-INF 
| | `-- spring 
| `-- src 
...(more folders) 

94 directories 

tree -d dst 
dst 
|-- com.boco.gdpp.taskserver.core 
| |-- lib 
| |-- META-INF 
| | `-- spring 
| `-- src 
|  `-- com 
|   `-- boco 
|    `-- gdpp 
|     `-- taskserver 
|      |-- config 
|      | `-- exports 
|      |  `-- exceptions 
|      |-- export 
|      | |-- bean 
|      | | |-- enums 
|      | | `-- processdef 
|      | `-- util 
|      |  `-- processtree 
|      `-- msg 
|       `-- support 
|-- com.boco.gdpp.taskserver.gsp.gworkflow 
| |-- libs 
| |-- META-INF 
| | `-- spring 
| `-- src 
...(more folders) 

88 directories 

回答

3

-C選項導致rsync忽略的文件和目錄匹配各種圖案,其包括core。此名稱通常用於進程故障轉儲文件。從手冊頁:

The exclude list is initialized to: 

    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/ 

您可以覆蓋這與:

--include=core