gpt4 book ai didi

linux - rsync 在本地备份期间丢失了一个文件夹

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:55:25 25 4
gpt4 key购买 nike

当我使用以下脚本在本地备份文件夹时,省略了子文件夹“core”:

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”的结构,“core”不是最深的子文件夹。为什么“core”不能复制到“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

最佳答案

-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

关于linux - rsync 在本地备份期间丢失了一个文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20260432/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com