我正在使用rdiff-backup。真的很棒的简单强大的备份工具。不过,我正在与通配符模式作斗争。我有这个目录结构:如何使用rdiff-backup排除通配符目录但包含通配符文件?
/data/aaa/cache
/data/bbb/cache
/data/ccc/cache
etc....
在每个缓存目录中都有原始文件和缓存文件。原始文件简单地命名为1.jpg
,2.png
,3.gif
等等。缓存文件具有附加到原始文件名的一些字符串。
所以我想备份所有/ data/*/cache目录,但只包含原始文件,而不包含缓存文件。
我使用这个命令:
rdiff-backup --exclude **/cache --include **/cache/+([0-9]).+([a-z]) /data /backup
但rdiff进行备份的回报这一点,我很失落:
Found interrupted initial backup. Removing...
Fatal Error: Last selection expression:
Command-line include glob: **/cache/+([0-9]).+([a-z])
only specifies that files be included. Because the default is to
include all files, the expression is redundant. Exiting because this
probably isn't what you meant.
是否要排除不在缓存目录下的任何*其他文件或目录? – 2014-10-15 19:40:54