PDA

View Full Version : Cron Log?



j103c
06-17-2004, 08:50 AM
Hi,

I'm having trouble on one of my accounts with awstats not being run via cron. It works fine manually, but not when I want it run as a cron job.

When I test manually, I'm using the same command that is in the cron file, so I see no differences or reasons why it might fail. Here is the line currently:


45 * * * * /var/www/cgi-bin/awstats.pl -config=website -update

I don't really want it to run every hour, I just have that set for testing..

Is there any type of cron job log I can use to troubleshoot this? I'm at a loss as to how to try to figure out what's going on..

Thanks..

dpfaigin
06-17-2004, 01:00 PM
I had a problem like that. Remember that your cron job may be running with a different environment than you have at the command line (in particular, it has a home of "/"). This may be more of a problem for home written scripts.

j103c
06-17-2004, 01:05 PM
I've checked paths in the config file to make sure they are absolute, but I'll check again.. I'm guessing it's something like that, just sure would be nice to see some errors or something.

jalal
06-17-2004, 04:31 PM
What I do is run a short script:

01 0 * * * /home/mydomain/bin/awstats-up

where awstats-up is:

#!/bin/sh
cd /var/www/cgi-bin/
./awstats.pl -config=www.mydomain.com -update
./awstats.pl -config=mail.mydomain.com -update

Seems to work fine...

But, on other sites, I use exactly the same cron job as you do and that seems to work fine as well.

HTH

dansroka
06-18-2004, 04:23 AM
Don't forget that you can also tell the cron job to send its output (any text messages it generates) to a text file, like so:


1 * * * * ./var/www/cgi-bin/awstats.pl -config=www.mydomain.com -update > /var/log/cron_result.txt

The "> /var/log/cron_result.txt" creates a text file (called 'cron_result.txt') that you can open to confirm that it did what it was supposed to. You can then check the date/time the file was created to confirm when it was run.

j103c
06-18-2004, 07:16 AM
Thanks for the tip dansroka! I'll have to use that cause I'm still lost..

I've hunted through my awstats file and I still don't get it. The automated process for awstats for mail statistics runs fine. :roll:

j103c
06-18-2004, 08:28 AM
dansroka - thanks tons. I was able to get an error from awstats, which gives me something to troubleshoot off of. :)

firebirdfan
01-25-2005, 08:16 PM
I've set the cron to run sendmail clear que periodically & to have an output as /var/log/cron.txt but there's nothing written on the file. What does this indicates ? thanks