AWStats + crontab = errors



I’m having a problem getting crontab to “take” my command to regularly update AWStats. Here’s what I did:

  1. Entered the following at a command prompt:

crontab -e

  1. In the editor, I entered the following text:

0 2 * * * perl /home/username/awstats/tools/ -update -awstatsprog=/home/username/awstats /cgi-bin/ -dir=/home/username/

(note: This is all one line, my username is replaced with “username” and my domain is replaced with “”. There is also a blank line after the above command line.)

  1. I save the file and exit the editor, and get the following error message:

[beverly]$ crontab genstats.ctab
"genstats.ctab":0: bad minute
errors in crontab file, can’t install.

  1. Issuing crontab -l tells me that there is no crontab for this user.

So, I looked in the crontab page on the DH Wiki, and followed the command syntax exactly (I think) but I still get the error. I tried creating the file manually and issued a crontab filename command, and that gave the same error.

Anyone have any solution as to how to get this working?




OK, I just solved the error…

The Wiki shows example crontab parameters in the following form:

0 2 * * * program

That fails.

When I enter as:

00 02 * * * program

it works.

So, make sure you use 2 digit numbers!

Hope this helps someone!



As a test could you try it as
00 2 * * * program
to see if that works just out of interest since only the first minutes digits requires the double digit setting. Putting 02 in the hour spot is okay but I am sure it is not a requirement if you see what I mean.



I will put a note in the wiki about this, but odly enough I tested on my server (galaga) and single digit minutes and hours work just fine.

–Matttail - personal website