我正在使用rsync
递归同步一个看起来像这样的远程文件夹树:
/folderA/a1/cache
/folderA/a1/cache/A1
/folderA/a1/cache/A2
/folderA/a1/somefolder
/folderA/a1/someotherfolder
/folderA/a2/somefolder/cache
/folderB/cache/
/folderB/b1/somefolder/cache
/folderB/b1/somefolder/yetanotherfolder/cache
/folderB/b1/somefolder/yetanotherfolder/cache/B1
/folderB/b1/somefolder/yetanotherfolder/cache/B2
Run Code Online (Sandbox Code Playgroud)
我不知道文件夹树会是什么样子,它会随着时间的推移而改变。所以我想要做的是递归rsync
上述但排除文件夹“缓存”和它包含的任何子文件夹:
/folderA/a1
/folderA/a1/somefolder
/folderA/a1/someotherfolder
/folderA/a2/somefolder
/folderB/
/folderB/b1/somefolder
/folderB/b1/somefolder/yetanotherfolder/
Run Code Online (Sandbox Code Playgroud)
有什么建议?
rsync ×1