TechTalkz.com Logo Ask the Expert

Go Back   TechTalkz.com Technology & Computer Troubleshooting Forums > Tech Support Archives > Linux & Opensource > Unix

Notices

crontab question

Unix


Reply
 
Thread Tools Display Modes
Old 15-09-2007, 11:08 AM   #1
YZXIA
Guest
 
Posts: n/a
crontab question

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

  Reply With Quote
Old 15-09-2007, 11:08 AM   #2
boyd
Guest
 
Posts: n/a
Re: crontab question

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
  Reply With Quote
Old 15-09-2007, 11:09 AM   #3
Keith Thompson
Guest
 
Posts: n/a
Re: crontab question

boyd <tbmoore9@verizon.net> writes:
> 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 )


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.
  Reply With Quote
Old 15-09-2007, 11:09 AM   #4
Michael Tosch
Guest
 
Posts: n/a
Re: crontab question

Keith Thompson wrote:
> boyd <tbmoore9@verizon.net> writes:
>> 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 )

>
> 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"
>


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"


--
Michael Tosch @ hp : com
  Reply With Quote
Old 15-09-2007, 11:09 AM   #5
Keith Thompson
Guest
 
Posts: n/a
Re: crontab question

Michael Tosch <eedmit@NO.eed.SPAM.ericsson.PLS.se> writes:
> Keith Thompson wrote:

[...]
>> If you really need all the settings from your .cshrc, you can do
>> this:
>> 29 * * * * csh -c "source .cshrc ; some_command"
>>

>
> 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.
  Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
crontab Qs pemo Unix 2 15-09-2007 11:04 AM
Newbie-Email via crontab Muffin FreeBSD 5 15-09-2007 10:55 AM
IE 7 question n9ejs Internet Explorer 3 29-08-2007 03:00 AM
IE7 question Willy Internet Explorer 4 29-08-2007 02:14 AM
question john marsden Windows XP 4 27-08-2007 11:07 PM


< Home - Windows Help - MS Office Help - Hardware Support >


New To Site? Need Help?

All times are GMT +5.5. The time now is 05:14 AM.


vBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO
Copyright © 2005-2010, TechTalkz.com. All Rights Reserved - Privacy Policy
Valid XHTML 1.0 Transitional