Re: cron problem

[email protected]
Newsgroups gmane.org.user-groups.luni.tech
Message-ID <[email protected]>
[Richard Reina]
> Thanks much for the replies thus far. When I do:
> [root@tomsawyer richard]# env | PATH
> 
> I get:
> 
> PATH:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin
> 
> Are you saying that I should put that exact line including the word PATH at t
> he top of cron file like this?
> 
> PATH:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin
> 1 9 * * 1 /usr/bin/perl /usr/local/src/scripts/inactive.pl
> 1 14 * * 1-6 /usr/bin/perl /usr/local/src/scripts/upcoming.pl

1 14 * * 1-6 PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/bin:/usr/bin /usr/bin/perl /usr/local/src/scripts/upcoming.pl

Is the example I suggest.

Just like from a command line (in a bourne style shell, anyway), you can
VAR=foo OTHERVAR=baz /path/to/command in your cron line.

There might be some features in your cron daemon to set a different
default path, but I can't speak to them.

And if you need a PERL5LIB set (which I suspect is your current issue,
not PATH), you can set it just as well in that same command line.

If you think the command line is looking gross, make a shell wrapper to
invoke the perl script with all the necessary environment variables set.

Good luck!

Geoff
-- 
Linux Users Of Northern Illinois (Chicago) - Technical Discussion 
http://luni.org/mailman/listinfo/luni
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.