On Tue, Mar 27, 2012 at 04:30:27PM +0530, Anirban Adhikary wrote:
> Hi
> I need to run a perl script from cron tab.
> 
> so I write a small shell script and call the perl script within that shell
> script.
> /usr/bin/perl /home/anirban/perl_code.pl
> 
> Before calling the perl script I copied all the contents of the .profile
> file and paste it within the shell script.
> 
> But still the code is not running.

cron problems are almost invariably due to environment or permissions
problems.  You seem to have addressed the environment part, so my guess
would be permissions.

The rest of the time the problem is to do with unescaped % characters.

All this assuming the script works correctly outside of cron.

Have you looked at the cron logs?

The easiest way to debug further is probably to redirect stderr and
stdout to a file in your crontab entry and narrow down the problems that
way.  This involves chaning the time the cronjob runs every time you
need to run a test, which is a real pain and seems like the sort of
thing for which there really should be a better solution.  With luck,
someone will reply and say what that solution is.

Good luck,

-- 
Paul Johnson - p...@pjcj.net
http://www.pjcj.net

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to