LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-22-2004, 06:55 PM   #1
dholingw
Member
 
Registered: Dec 2003
Distribution: Cent OS 4.1
Posts: 38

Rep: Reputation: 15
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@69.56.7.8:/home/paradox/public_html/remoteserver/

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@69.56.7.8:/home/paradox/public_html/remoteserver/ { send "bahbahbooey\n"}
expect "Password:"

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

spawn rsync --rsh=/usr/bin/ssh -avzrpog -e ssh /home/paradox/public_html/localserver/ paradox@69.56.7.8:/home/paradox/public_html/remoteserver/ send "bahbahbooey\n"
building file list ... link_stat paradox@69.56.7.8:/home/paradox/public_html/. : No such file or directory
done
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.

Dave
 
Old 02-08-2004, 10:11 AM   #2
ToniT
Senior Member
 
Registered: Oct 2003
Location: Zurich, Switzerland
Distribution: Debian/unstable
Posts: 1,357

Rep: Reputation: 47
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.
 
Old 02-08-2004, 10:27 AM   #3
dholingw
Member
 
Registered: Dec 2003
Distribution: Cent OS 4.1
Posts: 38

Original Poster
Rep: Reputation: 15
Why, thank you Sir

I finally figured that out, and it works great!

Appreciate the response,

Dave
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to use expect TomCruise2002 Linux - General 2 04-09-2017 08:00 AM
Expect how to? e-freak Programming 2 09-24-2005 04:49 AM
Installation of Expect 5.x tcl private headers Anarchon Linux - Software 0 07-08-2005 09:02 AM
Windows Rsync Upload to Linux Rsync - permissions inspleak Linux - Software 0 10-12-2004 02:49 PM
help with expect neyoung Programming 3 02-09-2004 09:41 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration