rsync删除选项不起作用

时间:2016-04-01 09:08:10

标签: unix rsync

rsync不会从目标目录中删除文件,但添加/修改文件正常工作。

当我使用以下命令时,我收到以下错误:

[MS-PROD-FTP]$rsync -rave --del "ssh -i $cert" $Local_Dir/* 

$USER@$Remote_Hostname:$Remote_Dir**

rsync: Failed to exec --del: No such file or directory (2)

rsync error: error in IPC code (code 14) at pipe.c(84) [sender=3.0.6]

rsync: connection unexpectedly closed (0 bytes received so far) [sender]

rsync error: error in IPC code (code 14) at io.c(600) [sender=3.0.6]

下面执行的命令没有错误,但是在dest目录中没有删除文件。

[MS-PROD-FTP]$rsync --del -rave  "ssh -i $cert" $Local_Dir/* 

$USER@$Remote_Hostname:$Remote_Dir**

sending incremental file list

sent 136 bytes  received 12 bytes  296.00 bytes/sec
total size is 66  speedup is 0.45

有人可以帮忙吗?

1 个答案:

答案 0 :(得分:1)

问题是/ *,正确的命令是:

rsync -rave --del“ssh -i $ cert”$ Local_Dir / $ USER @ $ Remote_Hostname:$ Remote_Dir /

谢谢,