Unix questions - crontab question

This is Interesting: Free IT Magazines  
Home > Archive > Unix questions > January 2007 > crontab question





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author crontab question
YZXIA

2007-01-06, 8:00 pm

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

boyd

2007-01-06, 8:00 pm

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
Keith Thompson

2007-01-06, 8:00 pm

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.
Keith Thompson

2007-01-06, 8:00 pm

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.
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com