D dareksbs Verified User Joined May 15, 2014 Messages 40 Nov 23, 2014 #1 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,
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,
redesb Verified User Joined May 10, 2004 Messages 193 Location Spain Nov 23, 2014 #2 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
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