Current User: Guest Login Register
Please consider registering


Register? | Lost Your Password?

Search Forums:


 






Minimum search word length is 3 characters – Maximum search word length is 84 characters
Wildcard Usage:
*  matches any number of characters    %  matches exactly one character

Cron Job to provide daily stats

Reply to Post Add a New Topic
UserPost

5:26 pm
April 22, 2010


barry694

Guest

Awstats was installed with an excellent guide from WebHostingHero. This was very easy and stats were running almost immediately. Stats are now being updated every 24 hours. Would like to receive stats every 2 hours and need to write a Crone Job to automate the task

Here is the problem. Awstats was installed into a directory called Stats NOT in the Cgi-Bin. Icons were installed in a direactory called Images.

All examples on the net refer to Crone Jobs to automate Awstats in the Cgi-bin. Various commands have been used in Crone Job without success

Only solution is to start again and reinstall in the cgi-bin but is this really necessary since the stats are working fineSmile

Any help please thank you

5:52 pm
April 22, 2010


Jean-Luc

Admin

posts 1043

Hi Barry,

You do not need to move AWStats to another directory. cron can control tasks in any directory.

Don't you have a "Cron jobs" icon in cPanel ? The cron interface within cPanel is user friendly and it allows you to change the schedule of execution of the cron jobs.

If you use a "classic" cron interface, you specify that the job must run every two hours with this kind of command:

0 */2 * * * user_name /full_path_to/awstats.pl -config=your_config -update >> /dev/null 2>&1

10:26 am
April 23, 2010


barry694

Guest

Thank you for your post.

Am really a dummy in respect of this code. Your example is similar to many others shown on the net. The problem that I have is how to replace 'user name / full path to/ your config. Would it be possible to provide a script with these items completed with a typical user. Then I would replace with those re my setup

Regards

Barry

6:31 pm
April 23, 2010


Barry694

Guest

0 */15 * * * barry694 /stats/awstats.pl -config=awstats.baztrad.com.conf -update >> /dev/null 2>&1

Will this update the states every 15 mins. Have looked at previous emails the server sends me and know its a path issue. Hope this is right this time

Thanks Barry

10:16 pm
April 23, 2010


Jean-Luc

Admin

posts 1043

I would try this:

*/15 * * * * barry694  /home/barry694/public_html/stats/awstats.pl config=baztrad.com -update >> /dev/null 2>&1

Note that:

- what you had was "every 15 hours", I changed it to "every 15 minutes"

- the full Linux path must be used for the command

- the config name is the central part of the name of the AWStats config file.

8:25 pm
April 24, 2010


barry694

Guest

Hi

Believe the script should work but it does not. Have removed dev/null 2>&1 because this produces an email that shows the problem. This is a syntax error and looking at the net it is a problem too far for me. Have continued to vary the command line input without success. My webhost has an excellent forum but there has not been one reply for help re this subject. Will leave Awstats updating every 24 hours. Thank you for your efforts to resolve the problemSmile

12:10 am
April 26, 2010


barry694

Guest

Jean-Luc

Stats are now updating every 15 minutes. As expected the problem was a path issue. Omitting dev/null 2>&1 was very helpful because this generated emails that provided ideas for a solution. Always like a challenge so am pleased this problem has been resolved. There are lots of sites on the net with information regarding this subject but found most to be confusing. The following site however was very helpful

http://master4life.com/update-…..g-cron-job

This command line in Cron works for me

*/15 * * * *

$HOME/public_html/stats/awstats.pl -config=baztrad.com -update

Will add dev/null 2>&1 to stop the emails

$HOME replaces /home/barry694/

Hope others will find this useful if your configeration is Apache Server +Linux

 

Reply to Post

Reply to Topic:
Cron Job to provide daily stats

Guest Name (Required):

Guest Email (Required):

NOTE: New Posts are subject to administrator approval before being displayed

Smileys
Confused Cool Cry Embarassed Frown Kiss Laugh Smile Surprised Wink Yell
Post New Reply

Guest URL (required)

Math Required!
What is the sum of:
12 + 9
   


About the InternetOfficer.com Forum

Forum Timezone: UTC 1

Most Users Ever Online: 201

Currently Online:
16 Guests

Currently Browsing this Topic:
1 Guest

Forum Stats:

Groups: 2
Forums: 9
Topics: 498
Posts: 2380

Membership:

There are 2068 Members
There have been 245 Guests

There is 1 Admin
There is 1 Moderator

Top Posters:

cssfsu – 55
albert_newton – 30
deepakgupta – 28
cosminpana – 20
DTNMike – 19
ahtshun83 – 17

Recent New Members: Diggy, mopl91, henrique, ScottWigle, mgshirinda, andersondj

Administrators: Jean-Luc (1043 Posts)

Moderators: Jean-Luc (1043 Posts)