Vincent Danen <[EMAIL PROTECTED]> wrote:
> Does anyone know how to use rsynch over ssh so that I can do it from a
> cron job? I use this script:
>
> #!/usr/bin/expect -f
> log_user 0
> spawn /usr/bin/rsync -avP --delete --stats -l -t -e ssh \
> user@somehost:/path/to/files /path/to/local
> expect "password: "
> send "secret\n"
> log_user 1
> interact
>
> I'm no expert with expect (at all), but this works fine on the
> commandline when I manually issue it, but from a cronjob, all I get
Do you mean 'rsync ...blah...blah...blah' works fine from the
command line, or the SCRIPT above works fine from the command line?
> reported in my cron log is the password and the rsynch doesn't take
> place. I copied this from somewhere else (I forget), and it's really
> starting to bug me as I really want cron to handle this... any idea
> how I can do this better or at least make this run in a cronjob?
Well, I went and read the expect man page, and my only guess is
that ssh may not want to talk through a pty, which seems pretty
strange.
One possibility, which I dislike extremely much, is to allow
the user who runs the cron job on the 'local' machine to
use ssh to the remote machine ('somehost') without a password.
(I greatly understated how much I dislike this idea!)
Anyway, if the SCRIPT works fine from the command line, then I'm
clue challenged by that one ;-)
rc
Rusty Carruth Email: [EMAIL PROTECTED] or [EMAIL PROTECTED]
Voice: (480) 345-3621 SnailMail: Schlumberger ATE
FAX: (480) 345-8793 7855 S. River Parkway, Suite 116
Ham: N7IKQ @ 146.82+,pl 162.2 Tempe, AZ 85284-1825
Keep in touch with http://mandrakeforum.com:
Subscribe the "[EMAIL PROTECTED]" mailing list.