Add to Favourites Add to Favourites    Print this Article Print this Article

I need awstats to rebuild the static html pages for previous months

Assuming the data for the require months does exist in here:


you should be able to re-generate your static html pages for those months.  The script below can do it for you:

if [ "$#" -eq 0 ]; then
         echo "Usage:";
         echo "    $0          exit 1;


for u in `ls /usr/local/directadmin/data/users`; do
         for d in `cat /usr/local/directadmin/data/users/$u/domains.list`; do
                   echo "";
                   echo "$u: $d: $month $full_year";
                   if [ ! -s $DATA ]; then
                             echo "Cannot find $DATA for $month $full_year. Skipping.";

                   /usr/bin/perl /usr/local/awstats/tools/
                       -config=$d -configdir=/home/$u/domains/$d/awstats/.data -update
                       -diricons=icon -awstatsprog=/usr/local/awstats/cgi-bin/
                       -dir=/home/$u/domains/$d/awstats -builddate=${short_year}${month}
                       -year=$full_year -month=$month

                   echo "";
exit 0;

save this to a script, say, and set it to 755.

Run it for each month, for example, April (month 04) 2014:

./ 04 14

Was this answer helpful?

Also Read