-   Programming (
-   -   TCL, Expect, for Rsync - Please Help (

dholingw 01-22-2004 07:55 PM

TCL, Expect, for Rsync - Please Help
Here's something that looks, and should be as simple as it comes, but nope.. I've been at this for two days, and cannot possibly understand what is going wrong. All it is, is a TCL script, which automatically rsync's into my backup server. Here's goes:

rsync -avzrpog -e ssh /home/paradox/public_html/localserver/ paradox@

Works cherry, but you need to manually enter the password. No good for cron jobs...

Now, let's try this automated methood:

#!/usr/bin/expect -f
spawn rsync --rsh=/usr/bin/ssh -avzrpog -e ssh /home/paradox/public_html/localserver/ paradox@ { send "bahbahbooey\n"}
expect "Password:"

### Here's the output: ###

spawn rsync --rsh=/usr/bin/ssh -avzrpog -e ssh /home/paradox/public_html/localserver/ paradox@ send "bahbahbooey\n"
building file list ... link_stat paradox@ : No such file or directory
wrote 565 bytes read 20 bytes 1170.00 bytes/sec
total size is 109631 speedup is 187.40
rsync error: some files could not be transferred (code 23) at main.c(620)

Ok, it successfully logged in, but for some odd reason, it thinks the target directory dosen't exsist. I just don't get it.. How can everything go so well, and then it claims the directory does not exsist. Does anyone have a simple script like this that actually works in the way I want it to? Posting it here, or any suggestions to my above one would really be appreciated.


ToniT 02-08-2004 11:11 AM

You get one error source less if you replace the expect script with ssh-keys.

See for example the ssh howto on how to set it up. The single purpose keys are imho somewhat overkill; own paswordless key for the scripit should be fine.

dholingw 02-08-2004 11:27 AM

Why, thank you Sir :)

I finally figured that out, and it works great!

Appreciate the response,


All times are GMT -5. The time now is 07:24 PM.