Version: 3.0.6<div>OS: CentOS 6.6</div><div><br></div><div>I met a strange problem when using rsync with expect. I wrote a script backing up using rsync and expect. However when I run the script twice for two different files at same time,  the two files on destination path would be deleted automatically before the files closed. The output of inotify_wait was like:</div><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><div>./ MODIFY .redo02.log.dOlbek</div></div></blockquote><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><div>./ DELETE .redo02.log.dOlbek</div></div><div><div>./ CLOSE_WRITE,CLOSE .redo02.log.dOlbek</div></div></blockquote>I didn't use any --del options and tried --ignore-errors --max-delete=0, but they didn't work. The problem happened only when two processes were running at same time.  Here is my script:<blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;"><div><div>#!/usr/bin/expect</div></div><div><div><br></div></div><div><div>log_user 0</div></div><div><div><br></div></div><div><div>set env(LANG) en_US.UTF-8</div></div><div><div><br></div></div><div><div>set user        "[lindex $argv 0]"</div></div><div><div>set bwlimit     "[lindex $argv 1]"</div></div><div><div>set timeout     "[lindex $argv 2]"</div></div><div><div>set src_path    "[lindex $argv 3]"</div></div><div><div>set dest_ip     "[lindex $argv 4]"</div></div><div><div>set dest_path   "[lindex $argv 5]"</div></div><div><div>set passwd      "[lindex $argv 6]"</div></div><div><div><br></div></div><div><div>spawn rsync -artqz4 -e "ssh -p 22 -o StrictHostKeyChecking=no -l $user" \</div></div><div><div>            --bwlimit=$bwlimit --timeout=$timeout "$src_path" "$dest_ip:$dest_path"</div></div><div><div><br></div></div><div><div>expect {</div></div><div><div>    "Connection refused" {exit 1}</div></div><div><div>    "Name or service not known" {exit 2}</div></div><div><div>    "Permission denied*" {exit 3}</div></div><div><div>    "continue connecting" {send "yes\r"; exp_continue}</div></div><div><div>    "password:" {send "$passwd\r"; exp_continue}</div></div><div><div>}</div></div><div><div><br></div></div><div><div>exit</div></div></blockquote><div><div>May I did something wrong? Thanks in advance.</div></div><div><br></div><div>Guangmu Zhu</div><div><br></div>