[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[cobalt-users] Re: Crontab Perl



You need to execute the script as a user. I.E.

00 08 * * *  username perl /path/to/schedule.cron

I wouldn't execute it as root, because the client could put malicious
instructions in the pl script.

Bill


> From: "Troy Arnold" <cobalt@xxxxxxxxxxxxxx>
> Subject: [cobalt-users] Crontab Perl
> Reply-To: cobalt-users@xxxxxxxxxxxxxxx
>
> A client has a perl file they want to run at 8:00 am every morning. I have
> setup a crontab under the user and have verified it is functioning.
However
> when the crontab attempts to run the perl (.pl) file it errors out. If I
run
> it manually (either as the user or as root)... perl thefile.pl it runs
fine
> without erroring (or so I am told).
>
> crontab file (ie schedule.cron)...
> 00 08 * * *    perl /path/to/schedule.cron
>
> the error in the cron log is...
> Can't locate BPE.pm in @INC (@INC contains:
> /usr/lib/perl5/5.00503/i386-linux /usr/lib/perl5/5.00503
> /usr/lib/perl5/site_perl/5.005/i386-linux /usr/lib/perl5/site_perl/5.005
.)
> at /path/to/perlfile/file.pl line 6.
> BEGIN failed--compilation aborted at
> /path/to/perlfile/file.pl line 6.
>
> At line 6 is simply a call to the BPE.pm which does not error when the
perl
> file is run manually.
>
> I have just changed the crontab to the following to see if it helps...
> 00 08 * * *    /usr/bin/perl /path/to/schedule.cron
> however I doubt it since it is attempting to run the perl file.
>
> Any ideas or advice would be helpful. Thanks in advance.
>
> Best regards,
> Troy Arnold