运行此命令时:
$ 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)