最近在执行rsync
的时候,发现报告错误信息cannot delete non-empty directory
,如下:
1 2 3 4 |
$ rsync -avzpP --delete -e "ssh -p $PORT" $USER@$SERVER:$WWW_DIR $WWW_DST cannot delete non-empty directory: xxxxx cannot delete non-empty directory: xxxxx cannot delete non-empty directory: xxxxx |
解决方法是增加--delete-excluded
即可,如下:
1 |
$ rsync -avzpP --delete --delete-excluded -e "ssh -p $PORT" $USER@$SERVER:$WWW_DIR $WWW_DST |