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