Showing results for 
Search instead for 
Did you mean: 

cron and autostat


cron and autostat

Hi there, I have webaliser running fine on crofters in a folder called stats. I can trigger it from the command line by doing "cd stats" then "./autostat". I've tried to do it with cron and have a file in which I've tried various combinations of path but it won't work. I can check with "crontab -l" and see that my attempts are loaded properly, so I just haven't hit on the right line. I understand how the times work. Lines I try are of the type:

33 1 * * * /files/local/home/eilands/stats/autostat

I guess I have the path wrong. Can anyone tell me what the path should be? Or what else might be wrong? I've tried setting permissions to full access from everybody.

Many thanks

Posts: 23
Registered: 31-07-2007

my problem also

I have the same learning problem, I raised a ticket.
My question
Webstats have been activated.
In 'crofters', I have followed your support pages and created a directory 'stats'.
I created a file 'autostat' by following your example.
By typing './autostat' all works fine.

I then created a crontab and this runs however I cannot get the file 'autostat' to run via this method.

I get an error message appear in the file 'Mailbox'.

/bin/sh: home/'sitename'/stats/autostat: No such file or directory

My command line is: 0 9 * * * /usr/bin/stats/./autostat
Can you help with the correct command to run 'autostat' from cron.
F9 reply
I am afraid we do nbot offer support on this. However if you ask your question agin in our cgi newsgroup or cgi forum on the portal, you should get a prompt reply from one of our users.

I live in hope!

Bob Finch
Posts: 1,886
Registered: 08-06-2007

cron and autostat

Hi there,

I think you just need to check the path. You can to this by telneting into the server, cd'ing to the stats directory and then typing

This will give you the current path.

Posts: 23
Registered: 31-07-2007

cron and autostat


I checked the path - it is /home/username/stats/

I tried /home/username/stats/autostat
Cron works now but returns the following error in the 'Mailbox' file

/home/username/stats/autostat: snarf: command not found
/home/username/stats/autostat: webalizer: command not found

What else am I missing, although I followed the webstats tutorial from the support pages, do I have to add the /home/username/stats/ in front of the first and second line.

One step forward then one backwards, at least it's progress as I have learnt something

Regards to all.
Posts: 1,886
Registered: 08-06-2007

cron and autostat

Hi again,

Something that I would always recomend (from personal experience) when having problems like this is to always specify full paths when you are not doing stuff directly through a terminal window.

So, where you are calling snarf use the full path, which is (I think):

You can find the full paths to the necessary programs by typing (for snarf as an example) the following from a terminal window:
whereis snarf

Please check the location of snarf before you do this since I am only remembering that (since I am not currently on a Force9 connection and cannot access the server to check).

Posts: 23
Registered: 31-07-2007



All the facts finally made it through to my grey matter.

Here are the points that matter:

autostat (file)
Line 1
/usr/local/bin/snarf -v /home/username/stats/stats.log
Line 2
/usr/local/bin/webalizer -c /home/username/stats/stats.conf
Line 3
rm -f /home/username/stats/stats.log

username.cron (file)
0 9 * * * /home/username/stats/autostat (for 0900 hrs each day)

stats.conf (file)
LogFile (line)
LogFile /home/username/stats/stats.log
OutputDir (line)

Perhaps an update to the F9 support page about WebStats would be nice.
It would help newbies like me.