-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Yes, you are doing something wrong. You are using expect to allow a password to be specified on the command line. Use ssh key authentication instead.
Now, as to your problem I couldn't duplicate it. I started an rsync of a large file, ^Z suspended it, confirmed that the temp file was present, then ran another rsync of a different file in the same directory and the original temp file was not touched or removed by the subsequent rsync. On 06/16/2015 02:38 AM, Guangmu Zhu wrote: > Version: 3.0.6 OS: CentOS 6.6 > > 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: > > ./ MODIFY .redo02.log.dOlbek > > ./ DELETE .redo02.log.dOlbek ./ CLOSE_WRITE,CLOSE > .redo02.log.dOlbek > > 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: > > #!/usr/bin/expect > > log_user 0 > > set env(LANG) en_US.UTF-8 > > set user "[lindex $argv 0]" set bwlimit "[lindex $argv > 1]" set timeout "[lindex $argv 2]" set src_path "[lindex > $argv 3]" set dest_ip "[lindex $argv 4]" set dest_path "[lindex > $argv 5]" set passwd "[lindex $argv 6]" > > spawn rsync -artqz4 -e "ssh -p 22 -o StrictHostKeyChecking=no -l > $user" \ --bwlimit=$bwlimit --timeout=$timeout "$src_path" > "$dest_ip:$dest_path" > > expect { "Connection refused" {exit 1} "Name or service not known" > {exit 2} "Permission denied*" {exit 3} "continue connecting" {send > "yes\r"; exp_continue} "password:" {send "$passwd\r"; exp_continue} > } > > exit > > May I did something wrong? Thanks in advance. > > Guangmu Zhu > > > - -- ~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._., - -*~ Kevin Korb Phone: (407) 252-6853 Systems Administrator Internet: FutureQuest, Inc. ke...@futurequest.net (work) Orlando, Florida k...@sanitarium.net (personal) Web page: http://www.sanitarium.net/ PGP public key available on web site. ~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._., - -*~ -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iEYEARECAAYFAlWAA3MACgkQVKC1jlbQAQc+zACfVdEPyK5CHEEZ/slSeOCUEgSD cN4AnR7F7Q1VIcEhm76l11zVU1/AgZbe =EE1e -----END PGP SIGNATURE----- -- Please use reply-all for most replies to avoid omitting the mailing list. To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html