On Thu, 22 Jul 1999, Jayme Frye wrote:
[snip]
> I the edited /etc/profile adding
> NEWSCLIPPER=/usr/etc, made sure it was exported and for good measure
> rebooted.
> Again from the command line I can run NewsClipper.pl as any user and it
> works fine. As a cron job it fails with this message:
>
> Can't locate NewsClipper.cfg in @INC (@INC contains:
> /home/minivend/.NewsClipper /usr/lib/perl5/5.00502/i686-linux
> /usr/lib/perl5/5.00502 /usr/lib/perl5/site_perl/5.005/i686-linux
> /usr/lib/perl5/site_perl/5.005 .) at /usr/bin/NewsClipper.pl line 106.
>
> So the array INC doesn't know about /usr/etc. Why not?
Cron runs under a restricted environment, and is not getting your NEWSCLIPPER
environment variable. Basically it runs /bin/sh, and doesn't process any
.profile files. What people usually do is put their commands in an sh script
that "sources" their profile and then executes the command:
. /etc/profile
. /home/username/.profile
/path/to/command/thecommand
Luckily, the GNU version of cron lets you set environment variables in the
crontab file, so you can insert "NEWSCLIPPER=/some/path" directly before you
call News Clipper.
Finally, if none of that works, you can always run it using Perl's -I switch
in your crontab file:
/usr/bin/perl -I/some/path /usr/local/bin/NewsClipper.pl
Of course, you can always explicitly specify the config file to News Clipper:
/usr/bin/perl /usr/local/bin/NewsClipper.pl -c /some/path/NewsClipper.cfg
I'll update the FAQ soon to make all this more clear.
David
_________________________________________________________________________
David Coppit - Graduate Student [EMAIL PROTECTED]
The University of Virginia http://coppit.org/
"Yes," said Piglet, "Rabbit has Brain." There was a long silence.
"I suppose," said Pooh, "that that's why he never understands anything."
-
If you would like to unsubscribe from this mailing list send an email to
[EMAIL PROTECTED] with the body "unsubscribe newsclipperlist
YOUR_EMAIL_ADDRESS" (without the quotes) or use the form provided at
http://www.NewsClipper.com/TechSup.htm#MailingList.