背景
使用 mv 命令報“/bin/mv: 參數列表過長”,也是第一遇到,查了一下,最后用rsync命令解決了。還好每臺服務器,都必裝rsync了,記錄如下。
命令
nohup rsync -av --remove-source-files --progress /public/tmp/video_cache/ /public/Spider_backup/other_server_img_video_server/video_cache/ > video_cache.log 2>&1 &
- –remove-source-files 同步成功,刪除源文件
- –progress 顯示進程
- /public/tmp/video_cache/ 源目錄
- /public/Spider_backup/other_server_img_video_server/video_cache/ 目標目錄
- video_cache.log 日志文件