Re: ssh2 and scp2 fails in crontab.
From: Stein Arne Storslett (sastorsl_at_THOU.SHALT.NOT.SPAM.broadpark.no)
Date: 08/31/05
- Next message: Stein Arne Storslett: "Re: Odd messages after upgrade"
- Previous message: Hans Blom: "Re: ssh2 and scp2 fails in crontab."
- In reply to: Hans Blom: "Re: ssh2 and scp2 fails in crontab."
- Next in thread: Neil W Rickert: "Re: ssh2 and scp2 fails in crontab."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Wed, 31 Aug 2005 10:30:43 GMT
<tocum2@yahoo.com> wrote in <1125438672.5cb411dc3de6da2388b7836ae7abd328@teranews>:
> all mail refused wrote:
>> On 2005-08-30, Hans Blom <tocum2@yahoo.com> wrote:
>>
>>
>>>I've written a few scripts that get files via scp2 and just touches a
>>>file at server with ssh2 to indicate successful download.
>>>The scripts run in Cshell.
>>>Interactively they run like a charm and admiring myself in the mirror I
>>>put them into crontab for periodic running.
>>>And.... The little buggers fail. I get a $status of 1 (generic error).
>>>Anyone got any ideas what to do?
>>
>>
>> Beside getting a decent shell you mean ?
>>
>> Environment and terminal differences probably exist between the conditions
>> at your shell prompt and in your cron jobs.
>>
>:-) I knew the choice of Cshell would be commented. OK, it has it's
> shortcomings, but you dont have to "if [[ d != 0 ]]" or (from my point
> of view) other monstreous constructions.
> Anyone got any decent comments on the problem, please?
Do you do "#!/bin/csh" at the top of your script? If not, your script
will run with the shell of the user or /bin/sh (depending on your
system). A csh-script will break in /bin/sh...
If you could provide a command with any actual sysout it will be easier
to say what's happening. An error code could come from ssh, your script
or any other thing that may fail.
If you could share your script (feel free to anonymize IP-adresses, etc.
of course) we can take a look.
...and yes, it's a bad habit to script in csh :-)
http://www.faqs.org/faqs/unix-faq/shell/csh-whynot/
-- Stein Arne
- Next message: Stein Arne Storslett: "Re: Odd messages after upgrade"
- Previous message: Hans Blom: "Re: ssh2 and scp2 fails in crontab."
- In reply to: Hans Blom: "Re: ssh2 and scp2 fails in crontab."
- Next in thread: Neil W Rickert: "Re: ssh2 and scp2 fails in crontab."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|