我正在使用rdiff-backup。非常棒的简单强大的备份工具。但是,我正在与通配符 glob 模式作斗争。我有这个目录结构:
/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-backup 返回这个,我迷路了:
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.