crontab problem?

Kevin Hodle kevinh at aos5.com
Thu Feb 13 18:25:45 CST 2003


Did you put this crontab entry in /etc/crontab, or a users crontab?  The
user the cron job is running as might not have permissions on the
directory you trying redirect the output to.  There is an entry in the
crontab file that specifies the user the job will run as, for instance,
intead of 

5 * * * * /usr/local/apache/cgi-bin/cal.pl

You would use:

5 * * * * root /usr/local/apache/cgi-bin/cal.pl  (the apache/http user
might work as well)

If you are running it from a user crontab, try using /etc/crontab
instead.

 
Kevin Hodle
Alexander Open Systems
Network Operations Center
kevinh at aos5.com

-----Original Message-----
From: Joe-Cho [mailto:joecho at everestkc.net] 
Sent: Thursday, February 13, 2003 12:10 PM
To: kclug at kclug.org
Subject: crontab problem?

Hello,

I have a quick question about crontab.
I have a small script that I made. I would like to execute this script
every hour. I did it on my crontab file like:

5 * * * * /usr/local/apache/cgi-bin/cal.cgi >
/usr/local/apache/htdocs/cal.html

It execute the script  cal.cgi every hour.
but the problem is that it doesn't have any content on cal.html it has
zero byte in it.

So, I created a perl script which execute this script.
I named /usr/local/apache/cgi-bin/cal.pl

I can excute this  script manually on the current directory that is
/usr/local/apache/cgi-bin/, but if I try on other directory, it
complains it.

It works fine if I do manually execute this script perl cal.pl

So, I put this script in the crontab like this:
5 * * * * /usr/local/apache/cgi-bin/cal.pl

Again, it execute this with zero byte.

All it does inside of the file cal.pl is to execute this comamand like
this:

/usr/local/apache/cgi-bin/cal.cgi > /usr/local/apache/htdocs/cal.html

Any suggestion??

Thanks in advance,

Joe Cho
joecho at everestkc.net
ksjoecho at yahoo.com
a member of kclug.




More information about the Kclug mailing list