Domain stats

dareksbs

Verified User
Joined
May 15, 2014
Messages
40
Hi Guys,

I would like to know if there is a way to get the last month visits number from Webalizer in terminal? can I grep webanalizer.hist somehow to get only last month visits number ?

Thanks,
 
You can try the following commands:
Code:
grep -A1 'Total Visits' /home/[user]/domains/[domain]/stats/usage_[YYYYMM].html|grep -v 'Total Visits'|cut -d'>' -f4|cut -d'<' -f1
Where:
[user] is the user that owns the domain
[domain] is the domain in which you want to obtain the total visits
[YYYYMM] are the year and month.​

If you need to get the result through a script, be sure to verify that the file exists before accessing it.

Hope it helps
 
Back
Top