Summary: cron job fails (expect, rsync)

Andreas Hoeschler ahoesch at smartsoft.de
Thu Mar 13 04:14:53 EST 2003


Hi all,

thanks to the overwhelming response. The problem indeed was that cron 
jobs inherit a different (poor) environment. My script called a binary 
which then called another script. This was superflously complex. I put 
everything in one script and also gave the complete path to ssh. Then it 
worked.

"Broun, Bevan" <brounb at adi-limited.com> and  Darren Dunham 
<ddunham at taos.com> suggested not to use expect at all but use ssh 
authentication with its .ssh/authorisedhost file instead. I will check 
out this approach later.

Thanks a lot,

   Andreas

>> Hi all,
>>
>> I have written the following script /opt/UploadIP/bin/uploadFile:
>>
>> #!/usr/local/bin/expect
>> set timeout -1
>> spawn rsync -avz -e ssh remoteIP <some user>@<some server>:<some dir>
>> expect "assword: "
>> send "...\r"
>> expect "speedup is"
>> sleep 1
>>
>> If I execute this script on the command line as root it works 
>> perfectly.
>> If I put the following line in "crontab -e"
>>
>> * * * * * /opt/UploadIP/bin/uploadFile
>>
>> I get the following mail:
>>
>> Your "cron" job on merkur
>> /opt/UploadIP/bin/uploadFile
>>
>> produced the following output:
>>
>> spawn rsync -avz -e ssh remoteIP <some user>@<some server>:<some dir>
>> couldn't execute "rsync": no such file or directory
>>      while executing
>> "spawn rsync -avz -e ssh remoteIP <some user>@<some server>:<some
>> dir>          "
>>      (file "/opt/UploadIP/bin/uploadFile" line 3)
>>
>> Any idea why this fails?
>>
>> Thanks,
>>
>>     Andreas
_______________________________________________
sunmanagers mailing list
sunmanagers at sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers




More information about the summaries mailing list