rsync从目录中排除空格


13

我正在尝试排除rsync的“ Mendeley Desktop”目录。

exclude-from =如下:

Downloads
*.o
*.iso
Dropbox
Documents/Mendeley\ Desktop

但是rsync仍在备份Mendeley Desktop。

如何使rsync忽略带空格的目录?

Answers:


18

\从空格前移开。转义空间用于阻止外壳在空间处分裂。当您使用文件列出您排除的目录和文件时,这些单词Mendeley Desktop将永远不会通过外壳,因此不需要转义。如果要在命令行中将它们列出,--exclude则需要转义空格。

使用:

Downloads
*.o
*.iso
Dropbox
Documents/Mendeley Desktop
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.