rsync 删除大量小文件

3 find with delete

复制代码代码如下:
 test  time find ./ -type f -delete        find ./ -type f -delete  0.43s user 11.21s system 2% cpu 9:13.38 total


用时9分钟。

 

4 rsync 首先建立空文件夹blanktest

复制代码代码如下:
 ~  time rsync -a --delete blanktest/ test/ rsync -a --delete blanktest/ test/  0.59s user 7.86s system 51% cpu 16.418 total


16s,很好很强大。

rsync -a  --delete tmp/  test/

--delete 删除目标文件下夹下的文件

原文地址:https://www.cnblogs.com/gaoyuechen/p/8543992.html