cancel
Showing results for 
Search instead for 
Did you mean: 

Using CRON to automate Webalizer

N/A

Using CRON to automate Webalizer

Apologies if this is a duplicate, but my reply to my original thread hasn't updated on the portal.

> > I seem to have answered it for myself as I uploaded my local 'fstat.conf' into the 'stats' sub-directory. This wouldn't work as it was not pointing to the log file. I changed the first line to
> > 'LogFile stats.log' and it now works OK. I've now set up a crontab to automate it, so hopefully all is well.
>
> Please let me know if I can help you any further.

Yes, hopefully. I've been fiddling around with CRON for the last few days. The tech. support page gives these examples;
0 * * * * /home/files1/username/scriptname.php

10 * * * * /home/files1/username/cgi-bin/script2.cgi

23 10 10 * * /home/files1/username/script.php

so I tried '0 2 * * * /home/files3/rcdalton/stats/autostat'

then I noticed that this was different from the path in the Web Stats tech. supp. so I tried '0 2 * * * /files/home3/rcdalton/stats/autostat'

Still no joy. 'autostat' runs fine from Telnet, but not using CRON. Can you see where I'm going wrong?

Paul Brooks
4 REPLIES
N/A

RE: Using CRON to automate Webalizer

> Apologies if this is a duplicate, but my reply to my original thread hasn't updated on the portal.
>
> > > I seem to have answered it for myself as I uploaded my local 'fstat.conf' into the 'stats' sub-directory. This wouldn't work as it was not pointing to the log file. I changed the first line to
> > > 'LogFile stats.log' and it now works OK. I've now set up a crontab to automate it, so hopefully all is well.
> >
> > Please let me know if I can help you any further.
>
> Yes, hopefully. I've been fiddling around with CRON for the last few days. The tech. support page gives these examples;
> 0 * * * * /home/files1/username/scriptname.php
>
> 10 * * * * /home/files1/username/cgi-bin/script2.cgi
>
> 23 10 10 * * /home/files1/username/script.php
>
> so I tried '0 2 * * * /home/files3/rcdalton/stats/autostat'
>
> then I noticed that this was different from the path in the Web Stats tech. supp. so I tried '0 2 * * * /files/home3/rcdalton/stats/autostat'
>
> Still no joy. 'autostat' runs fine from Telnet, but not using CRON. Can you see where I'm going wrong?


Hi Paul,

I have never used CRON before, so I am unable to help you on this one. The chap who takes over from me this afternoon, does. I am sure he will answer your questions.

If I can help you with anything else, please let me know.

Regards,

Dave

--
| David Scarpa...................Unmetered & ADSL solutions
| Senior Technical Consultant...........for Home & Business
| PlusNet Technologies Ltd............@ http://www.plus.net
+ ----- My Referrals - It pays to recommend PlusNet -----
kjaerligkatt
Grafter
Posts: 411
Registered: 02-09-2007

RE: Using CRON to automate Webalizer

It sounds like you've fallen into the same trap as I did. You need to use the FULL path to webalizer in your script that is being executed by the cron job.

You can find the full path from a telnet session:

locate webalizer

From memory its /usr/local/bin

Neil
> Apologies if this is a duplicate, but my reply to my original thread hasn't updated on the portal.
>
> > > I seem to have answered it for myself as I uploaded my local 'fstat.conf' into the 'stats' sub-directory. This wouldn't work as it was not pointing to the log file. I changed the first line to
> > > 'LogFile stats.log' and it now works OK. I've now set up a crontab to automate it, so hopefully all is well.
> >
> > Please let me know if I can help you any further.
>
> Yes, hopefully. I've been fiddling around with CRON for the last few days. The tech. support page gives these examples;
> 0 * * * * /home/files1/username/scriptname.php
>
> 10 * * * * /home/files1/username/cgi-bin/script2.cgi
>
> 23 10 10 * * /home/files1/username/script.php
>
> so I tried '0 2 * * * /home/files3/rcdalton/stats/autostat'
>
> then I noticed that this was different from the path in the Web Stats tech. supp. so I tried '0 2 * * * /files/home3/rcdalton/stats/autostat'
>
> Still no joy. 'autostat' runs fine from Telnet, but not using CRON. Can you see where I'm going wrong?
>
> Paul Brooks

N/A

RE: Using CRON to automate Webalizer

> It sounds like you've fallen into the same trap as I did. You need to use the FULL path to webalizer in your script that is being executed by the cron job.
>
> You can find the full path from a telnet session:
>
> locate webalizer
>
> From memory its /usr/local/bin

Yes it is, thanks. I'm still having no luck though. Do I need the full path in every part of my 'autostat' script and in the various files in 'stats.conf'?

Paul Brooks
kjaerligkatt
Grafter
Posts: 411
Registered: 02-09-2007

RE: Using CRON to automate Webalizer

> Yes it is, thanks. I'm still having no luck though. Do I need the full path in every part of my 'autostat' script and in the various files in 'stats.conf'?
>
> Paul Brooks

It depends on what you're doing Smiley

My script is not written how I would like to, since 'snarf' won't work for my account, and Plusnet can't find out why. Therefore, I have to change the directory to my stats working directory before using 'wget', which doesn't allow a destination filename to be specified. This removes the need for a full pathname for the ftp.

Using full pathnames, however, isn't a bad idea.

Try redirecting the webalizer output to a text file to see what's going on in the script:

/usr/local/bin/webalizer ~c ~/stats.stats.conf > ~/log.txt

will put a file, log.txt, in your home directory. Open this to see if webalizer is generating any errors in your script.

Neil Gardner