Summary: cron job fails (expect, rsync)

From: Andreas Hoeschler <ahoesch_at_smartsoft.de>
Date: Thu Mar 13 2003 - 04:14:53 EST
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@adi-limited.com> and  Darren Dunham 
<ddunham@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@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers
Received on Thu Mar 13 04:18:24 2003

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:43:05 EST