I need your help here. I wrote one PERL script for PHP application which needs to be run for every 5 mins. This script will call PHP program, which will fetch data from MySQL DB and will generate a excel report and will mail those reports to specific users. Every thing seems to be fine when I ran this script manually with the command (perl reports.pl). But when I set this Perl in a cron tab, nothing works and reports are not getting generated.
Details: perl script path /opt/app/deweb/web/EDI/Microsoft/reports.pl
this script will call PHP program (/opt/app/deweb/web/EDI/Microsoft/reports.php
)
content of script
#!/usr/local/bin/perl
use Net::FTP;
use File::Copy;
use POSIX;
@errorreport = `php /opt/app/deweb/web/EDI/Microsoft/reports.php`;
print "@errorreport
";
exit;
It is working perfectly when running Manually using command - perl reports.pl
No results, when set in CRON:
*/5 7-19 * * * /usr/local/bin/perl /opt/app/deweb/web/EDI/Microsoft/reports.pl
Please note that this crontab is under super user account named webserv and my login is having access to edit under this super user account.
I'm editing this cron tab using command :: sudo -u webserv crontab -e