0

我正在尝试从终端运行以下代码行并且 rysnc 正常工作,但是,正如您从相关控制台输出中看到的那样,它不排除我想要的文件。我的语法有什么问题吗?

输入命令:

rsync -va --exclude="Frisnuk/((plugins/dynmap.*)|(orebfuscator_cache.*))" --force Frisnuk .backups/07.25.2013-13:05/MinecraftServer/Frisnuk

控制台输出:

...
Frisnuk/orebfuscator_cache/
Frisnuk/orebfuscator_cache/Frisnuk/
Frisnuk/orebfuscator_cache/Frisnuk/data/
Frisnuk/orebfuscator_cache/Frisnuk/data/region/
Frisnuk/orebfuscator_cache/Frisnuk/data/region/r.-1.-1.mcr
Frisnuk/orebfuscator_cache/Frisnuk/data/region/r.-1.-10.mcr
Frisnuk/orebfuscator_cache/Frisnuk/data/region/r.-1.-2.mcr
Frisnuk/orebfuscator_cache/Frisnuk/data/region/r.-1.-3.mcr
Frisnuk/orebfuscator_cache/Frisnuk/data/region/r.-1.-4.mcr
Frisnuk/orebfuscator_cache/Frisnuk/data/region/r.-1.-5.mcr
Frisnuk/orebfuscator_cache/Frisnuk/data/region/r.-1.-6.mcr
Frisnuk/orebfuscator_cache/Frisnuk/data/region/r.-1.-7.mcr
Frisnuk/orebfuscator_cache/Frisnuk/data/region/r.-1.-8.mcr
Frisnuk/orebfuscator_cache/Frisnuk/data/region/r.-1.-9.mcr
Frisnuk/orebfuscator_cache/Frisnuk/data/region/r.-1.0.mcr
Frisnuk/orebfuscator_cache/Frisnuk/data/region/r.-1.1.mcr
Frisnuk/orebfuscator_cache/Frisnuk/data/region/r.-1.2.mcr
Frisnuk/orebfuscator_cache/Frisnuk/data/region/r.-1.3.mcr
Frisnuk/orebfuscator_cache/Frisnuk/data/region/r.-1.4.mcr
Frisnuk/orebfuscator_cache/Frisnuk/data/region/r.-1.5.mcr
Frisnuk/orebfuscator_cache/Frisnuk/data/region/r.-2.-1.mcr
Frisnuk/orebfuscator_cache/Frisnuk/data/region/r.-2.-10.mcr
Frisnuk/orebfuscator_cache/Frisnuk/data/region/r.-2.-2.mcr
Frisnuk/orebfuscator_cache/Frisnuk/data/region/r.-2.-3.mcr
Frisnuk/orebfuscator_cache/Frisnuk/data/region/r.-2.-4.mcr
Frisnuk/orebfuscator_cache/Frisnuk/data/region/r.-2.-5.mcr
Frisnuk/orebfuscator_cache/Frisnuk/data/region/r.-2.-6.mcr
Frisnuk/orebfuscator_cache/Frisnuk/data/region/r.-2.-7.mcr
Frisnuk/orebfuscator_cache/Frisnuk/data/region/r.-2.-9.mcr
Frisnuk/orebfuscator_cache/Frisnuk/data/region/r.-2.0.mcr
Frisnuk/orebfuscator_cache/Frisnuk/data/region/r.-2.1.mcr
Frisnuk/orebfuscator_cache/Frisnuk/data/region/r.-2.2.mcr
Frisnuk/orebfuscator_cache/Frisnuk/data/region/r.-2.3.mcr
Frisnuk/orebfuscator_cache/Frisnuk/data/region/r.-2.4.mcr
Frisnuk/orebfuscator_cache/Frisnuk/data/region/r.-2.5.mcr
Frisnuk/orebfuscator_cache/Frisnuk/data/region/r.-3.-1.mcr
Frisnuk/orebfuscator_cache/Frisnuk/data/region/r.-3.-10.mcr
Frisnuk/orebfuscator_cache/Frisnuk/data/region/r.-3.-2.mcr
Frisnuk/orebfuscator_cache/Frisnuk/data/region/r.-3.-3.mcr
Frisnuk/orebfuscator_cache/Frisnuk/data/region/r.-3.-4.mcr
Frisnuk/orebfuscator_cache/Frisnuk/data/region/r.-3.-5.mcr
...

编辑: 正如rsync --exclude not exclude specific files所建议的,我做了相对于源的排除,但是,这也失败了:

rsync -va --exclude="((plugins/dynmap.*)|(orebfuscator_cache.*))" --force Frisnuk .backups/07.27.2013-02:30/MinecraftServer/Frisnuk
4

1 回答 1

3

rsync 过滤规则不是非正则表达式,试试这个:

rsync -va --exclude='Frisnuk/plugins/dynmap/**' --exclude='Frisnuk/orebfuscator_cache/**'  ...
于 2013-07-27T06:43:05.030 回答