logos

With Andrii Grytsenko


Technical Diary - With Andrii Grytsenko

Simple web statistic script

There is a little script which provide simple statistic about web visitation.

Set “rotation_period” by days at variable section to define log rotation period. Set to “0″ if you want to turn off rotation.

NOTICE: This script works only if perl interpreter is available on web server. You can check it in next way:
$ perl -v

This is perl, v5.8.8 built for x86_64-Linux

Copyright 1987-2006, Larry Wall

You can view and download it from here.

This script should be put into the web server. My web-hoster doesn’t allow me send mail through shell. That’s why all lines concerning mail issue are commented out in my script. In case your hoster provides you this feature you can use it after drop comments and define variables related to mail.

Don’t forget to put script in the crontab. It’s should be executed at the end of the day:
$ crontab -l
# DO NOT EDIT THIS FILE - edit the master and reinstall.
# (/tmp/crontab.XXXXQpChAn installed on Sun Jun 14 21:56:42 2009)
# (Cron version V5.0 -- $Id: crontab.c,v 1.12 2004/01/23 18:56:42 vixie Exp $)
HOME=/home/virtwww/w_andriigrytse-net_9c210a4f
SHELL=/bin/bash
MAILTO=w_andriigrytse-net_9c210a4f

59 23 * * * $HOME/stat.pl

Good luck:)

Leave a Reply

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Categories

Translate