小编tom*_*all的帖子

rsync “无法删除非空目录”错误,即使使用 --force 选项

运行此命令时:

$ sudo rsync -r --delete --force --checksum --exclude=uploads /data/prep/* /data/app/
Run Code Online (Sandbox Code Playgroud)

我得到以下输出:

cannot delete non-empty directory: html/js/ckeditor/_source/plugins/uicolor/yui
cannot delete non-empty directory: html/js/ckeditor/_source/plugins/uicolor/yui
cannot delete non-empty directory: html/js/ckeditor/_source/plugins/uicolor
cannot delete non-empty directory: html/js/ckeditor/_source/plugins/uicolor
cannot delete non-empty directory: html/js/ckeditor/_source/plugins
cannot delete non-empty directory: html/js/ckeditor/_source/plugins
cannot delete non-empty directory: html/js/ckeditor/_source
cannot delete non-empty directory: html/js/ckeditor/_samples
cannot delete non-empty directory: html/js/ckeditor/plugins/uicolor/yui
cannot delete non-empty directory: html/js/ckeditor/plugins/uicolor/yui
cannot delete non-empty directory: html/js/ckeditor/plugins/uicolor
Run Code Online (Sandbox Code Playgroud)

通过阅读man rsync我的印象,该--force选项会告诉 rsync 删除这些非空目录,这是预期的结果。

参考:

--force                 force deletion of …
Run Code Online (Sandbox Code Playgroud)

rsync gentoo man deleting

31
推荐指数
2
解决办法
3万
查看次数

标签 统计

deleting ×1

gentoo ×1

man ×1

rsync ×1