这是我的rsync
命令:
rsync -av --progress \
--exclude=".*" \
--exclude="target/*" \
--exclude="src/main/docker" \
--exclude="src/test" \
~/projects/workarea/arxius-linia/backend/ \
~/projects/workarea/arxius-linia/gene/backend/
然而,似乎有些东西不同步,因为:
$ diff -qr --exclude=.git --exclude=".*" \
~/projects/workarea/arxius-linia/backend \
~/projects/workarea/arxius-linia/gene/backend
diff
命令让我有一些差异:
Only in /home/jeusdi/projects/workarea/arxius-linia/gene/backend/src/main/java/net/gencat/clt/arxius/backend/constants: BookConstants.java
Only in /home/jeusdi/projects/workarea/arxius-linia/gene/backend/src/main/java/net/gencat/clt/arxius/backend/constants: ParticipateConstants.java
Only in /home/jeusdi/projects/workarea/arxius-linia/gene/backend/src/main/java/net/gencat/clt/arxius/backend/controller: BookDocumentationController.java
Only in /home/jeusdi/projects/workarea/arxius-linia/gene/backend/src/main/java/net/gencat/clt/arxius/backend/controller/impl: BookDocumentationControllerImpl.java
Only in /home/jeusdi/projects/workarea/arxius-linia/gene/backend/src/main/java/net/gencat/clt/arxius/backend/controller/impl: ParticipateControllerImpl.java
Only in /home/jeusdi/projects/workarea/arxius-linia/gene/backend/src/main/java/net/gencat/clt/arxius/backend/controller: ParticipateController.java
Only in /home/jeusdi/projects/workarea/arxius-linia/gene/backend/src/main/java/net/gencat/clt/arxius/backend/dao: BookDocDAO.java
Only in /home/jeusdi/projects/workarea/arxius-linia/gene/backend/src/main/java/net/gencat/clt/arxius/backend/dao: BookDocumentationRepository.java
Only in /home/jeusdi/projects/workarea/arxius-linia/gene/backend/src/main/java/net/gencat/clt/arxius/backend/dao: ParticipateDAO.java
Only in /home/jeusdi/projects/workarea/arxius-linia/gene/backend/src/main/java/net/gencat/clt/arxius/backend/dao: ParticipateRepository.java
Only in /home/jeusdi/projects/workarea/arxius-linia/gene/backend/src/main/java/net/gencat/clt/arxius/backend/dao: StatisticsDAO.java
Only in /home/jeusdi/projects/workarea/arxius-linia/gene/backend/src/main/java/net/gencat/clt/arxius/backend/domain: BookDocumentationDomainModel.java
Only in /home/jeusdi/projects/workarea/arxius-linia/gene/backend/src/main/java/net/gencat/clt/arxius/backend/domain: BookUnitDomainModel.java
Only in /home/jeusdi/projects/workarea/arxius-linia/gene/backend/src/main/java/net/gencat/clt/arxius/backend/domain/form: BookDocumentationFormModel.java
Only in /home/jeusdi/projects/workarea/arxius-linia/gene/backend/src/main/java/net/gencat/clt/arxius/backend/domain/form: ParticipateFormModel.java
Only in /home/jeusdi/projects/workarea/arxius-linia/gene/backend/src/main/java/net/gencat/clt/arxius/backend/domain: ParticipateDomainModel.java
Only in /home/jeusdi/projects/workarea/arxius-linia/gene/backend/src/main/java/net/gencat/clt/arxius/backend/service: BookDocumentationService.java
Only in /home/jeusdi/projects/workarea/arxius-linia/gene/backend/src/main/java/net/gencat/clt/arxius/backend/service: ParticipateService.java
Only in /home/jeusdi/projects/workarea/arxius-linia/gene/backend/src/main/resources/mailTemplates: MailParticipateArchive.ftlh
Only in /home/jeusdi/projects/workarea/arxius-linia/gene/backend/src/main/resources/mailTemplates: MailParticipateValidation.ftlh
Only in /home/jeusdi/projects/workarea/arxius-linia/gene/backend/src/main/resources/mailTemplates: SubjectParticipateArchive.ftlh
Only in /home/jeusdi/projects/workarea/arxius-linia/gene/backend/src/main/resources/mailTemplates: SubjectParticipateValidation.ftlh
有任何想法吗?
您列出的文件
Only in ...
都位于目标目录下。这意味着这些文件在您运行rsync
命令之前就已经存在。如果要从目标目录中删除这些文件,可以使用该选项运行该
rsync
命令。--delete
这样做会删除源目录层次结构中不存在的目标目录层次结构中的所有文件。--delete-excluded
如果您需要删除目标上与您的任何排除模式匹配的文件,您可能还需要使用该选项进行调查。考虑首先在数据副本上进行测试,或者至少使用
--dry-run
选项(或-n
)来查看哪些文件rsync
将被删除,并始终进行频繁备份。