rsync & expect Help required Immediately.

From: Amit Kaushal (amit_at_billdesk.com)
Date: 10/29/03


Date: 29 Oct 2003 11:38:44 -0800

Hi,

I am trying to automate the process of rsync between to servers using
expect.
The script below is NOT doing what i want it to do. I have named this
script as expect.sh

#!/usr/local/bin/expect
set timeout -1
rsync -avvv -e ssh rsync@xxx.xxx.xxx.xxx:/Files_Outgoing/
 /home2/aaaa/Y/FILES/UPLOADED/
expect "Password:"
send "*******"

i invoke it like
sh expect.sh ( The output is pasted below, First of all it dumps the
rsync command on to the screen and then it gets stuck at password
prompt)

sh expect.sh
opening connection using ssh xxx.xxx.xxx.xxx -l rsync rsync --server
--sender -vvvlogDtpr . /aaa/aaa/Files_Outgoing/
rsync@xxx.xxx.xxx.xxx's password:
Permission denied, please try again.
rsync@xxx.xxx.xxx.xxx's password:
Permission denied, please try again.
rsync@xxx.xxx.xxx.xxx's password:
Permission denied (publickey,password,keyboard-interactive).
rsync: connection unexpectedly closed (0 bytes read so far)
rsync error: error in rsync protocol data stream (code 12) at
io.c(165)
_exit_cleanup(code=12, file=io.c, line=165): about to call exit(12)
couldn't read file ":\r": no such file or directory
expect.sh: send: not found

Can anyone point me in the right direction. Am really stuck and all
help/ advice would be great.

You may mail me at amit@billdesk.com

Thanks in advance,
Best Regards,
Amit Kaushal



Relevant Pages

  • Re: [SLE] running rsync from a script
    ... I need rsync to run via a script using ssh as the transport ... CP>keys on the server, so thats out of the question at this point. ... running on the remote server. ...
    (SuSE)
  • Re: the mail trail...sendmail
    ... I then msg from my hotmail acct. ... msg comes in...fine I then rsync /var/spool/mail/rado to other machine. ... I then run my script to shut down servers etc and switch machines and ... > Scot L. Harris wrote: ...
    (Fedora)
  • Re: How do I move an account... A few more details... and more
    ... >> use this system as a backup system if the first ever goes down. ... >> rsync for this. ... >serv1 and the system you back up to is fs. ... >rsync script. ...
    (Fedora)
  • Re: script doesnt work when run as cron job
    ... >>Call env in the script so you can see what is in the environment. ... It should be mailed to you (or root, or whoevers' cron job it is). ... Attempting to start rsync ...
    (comp.unix.shell)
  • Re: Two-way Sync of Directories - how? (rsync?)
    ... >I have two workstations I use connected ... >to run a cron job to sync the directories. ... >seems to work only in one direction (I know I could set up the script on ... I would do this with two rsync runs from one machine ...
    (freebsd-questions)