crontab question
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix questions > crontab question




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    crontab question  
YZXIA


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-07-07 01:00 AM

I am having diffculty with running cron job on my Solaris 8 box.

We are currently using C_Shell on our Solaris UNIX system. Every time
my schedule job is ran I get the following error message:

/export/home/xia_j/call_checkSeller: sqsh: not found

cron isnt reading the enviorment variables from .cshrc. How do I
configure the crontab so that the above issue is resolved

Thank You






[ Post a follow-up to this message ]



    Re: crontab question  
boyd


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-07-07 01:00 AM

In article <1167769690.454384.165200@42g2000cwt.googlegroups.com>,
"YZXIA" <yzx27@hotmail.com> wrote:

> I am having diffculty with running cron job on my Solaris 8 box.
>
> We are currently using C_Shell on our Solaris UNIX system. Every time
> my schedule job is ran I get the following error message:
>
> /export/home/xia_j/call_checkSeller: sqsh: not found
>
> cron isnt reading the enviorment variables from .cshrc. How do I
> configure the crontab so that the above issue is resolved
>
> Thank You

The cron program usually uses just sh, not csh, so it doesn't see the
.cshrc.  You can set the environment something like this in the crontab:
(not tested)

29 * * * * ( myvar='this'; export myvar; /usr/local/bin/dowhat >
/usr/local/log/dowhat.log 2>&1 )

Boyd





[ Post a follow-up to this message ]



    Re: crontab question  
Keith Thompson


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-07-07 01:00 AM

boyd <tbmoore9@verizon.net> writes:
> In article <1167769690.454384.165200@42g2000cwt.googlegroups.com>,
>  "YZXIA" <yzx27@hotmail.com> wrote:
> 
>
> The cron program usually uses just sh, not csh, so it doesn't see the
> .cshrc.  You can set the environment something like this in the crontab:
> (not tested)
>
> 29 * * * * ( myvar='this'; export myvar; /usr/local/bin/dowhat >
> /usr/local/log/dowhat.log 2>&1 )

Easier:

29 * * * * myvar='this' /usr/local/bin/dowhat > /usr/local/log/dowhat.log 2>
&1

If you really need all the settings from your .cshrc, you can do this:

29 * * * * csh -c "source .cshrc ; some_command"

Or you can write a wrapper script that handles whatever settings you
want and then invokes your target program, then just invoke the
wrapper script from your crontab.

--
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
San Diego Supercomputer Center             <*>  <http://users.sdsc.edu/~kst>
We must do something.  This is something.  Therefore, we must do this.





[ Post a follow-up to this message ]



    Re: crontab question  
Keith Thompson


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-07-07 01:00 AM

Michael Tosch <eedmit@NO.eed.SPAM.ericsson.PLS.se> writes:
> Keith Thompson wrote:
[...] 
>
> will source it *twice*, because
> csh always sources .cshrc unless invoked with -f.
> To source it *once*, it must be
>
> csh -c "some_command"
> or
> csh -fc "source .cshrc ; some_command"

Yes, thanks for the correction.

--
Keith Thompson (The_Other_Keith) kst-u@mib.org  <http://www.ghoti.net/~kst>
San Diego Supercomputer Center             <*>  <http://users.sdsc.edu/~kst>
We must do something.  This is something.  Therefore, we must do this.





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 12:34 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register