Results 1 to 8 of 8

Thread: Cron Log?

  1. #1
    Senior Member
    Join Date
    Mar 2004
    Location
    U.S.A.
    Posts
    220

    Default Cron Log?

    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:

    Code:
    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..

  2. #2
    Member
    Join Date
    Apr 2004
    Location
    North Hills, California
    Posts
    63

    Default

    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.
    H: faigin -at cahighways -dot org
    Learn about Judaism: http://www.mljewish.org, http://www.scjfaq.org
    Drive California Highways: http://www.cahighways.org
    Play more boardgames: http://www.boardgamegeek.com

  3. #3
    Senior Member
    Join Date
    Mar 2004
    Location
    U.S.A.
    Posts
    220

    Default

    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.

  4. #4
    Senior Member jalal's Avatar
    Join Date
    May 2003
    Location
    Germany
    Posts
    1,377

    Default

    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

  5. #5
    Senior Member dansroka's Avatar
    Join Date
    Nov 2003
    Location
    New Jersey
    Posts
    177

    Default

    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:

    Code:
    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.

  6. #6
    Senior Member
    Join Date
    Mar 2004
    Location
    U.S.A.
    Posts
    220

    Default

    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:

  7. #7
    Senior Member
    Join Date
    Mar 2004
    Location
    U.S.A.
    Posts
    220

    Default

    dansroka - thanks tons. I was able to get an error from awstats, which gives me something to troubleshoot off of.

  8. #8
    Senior Member
    Join Date
    Nov 2003
    Posts
    248

    Default

    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

Similar Threads

  1. Creating new log files from old ones
    By MarkDHamill in forum General Discussion
    Replies: 4
    Last Post: 07-27-2007, 11:36 AM
  2. cron wget php
    By mayjune2004 in forum General Discussion
    Replies: 2
    Last Post: 01-10-2006, 11:03 AM
  3. Need Cron Job Primer (I think!)
    By ccwebb in forum PHP / MySQL
    Replies: 3
    Last Post: 10-02-2005, 01:48 PM
  4. Cron job help
    By marcia in forum CGI Scripts / Perl
    Replies: 3
    Last Post: 03-29-2005, 07:39 AM
  5. Log In problems with Windows 2000
    By REC-WH in forum Account Maintenance
    Replies: 7
    Last Post: 09-05-2003, 12:17 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •