Move from Awstats plugin to DA built-in Awstats

jouwnaam

Verified User
Joined
Mar 17, 2005
Messages
39
I wrote a small script (based on help.directadmin.com) to move existing awstats plugin data to Direct Admin's own Awstats data. Mostly usefull for new installs, since it will overwrite the current data.

What this script does:
- remove awstats folder in public_html folders and create symbolic link to DA awstats (public_html/../awstats)
- move awstats plugin data (/home/user/domains/domain/stats/awstats*.txt) to correct folder for DA's own awstatsv(/home/user/domains/domain/awstats/.data

While I checked all of this, I might have made some mistakes. So no guarantees here. Use this at your own risk!

Code:
#!/bin/sh

# Remove old awstats folder and create link to DA awstats

for i in `ls -d /home/*/domains/*/public_html/awstats`; do
{
   if [ -h $i ]; then
     echo "$i is a link, skipping";
     continue;
   fi

   echo "Removing old awstats folder $i and creating link to DA awstats";
   rm -rf $i
   ln -s ../awstats $i
};
done;

# Move old awstats data to DA awstats data

for i in `ls -d /home/*/domains/*/stats`; do
{
  if [ ! -d $i/../awstats ]; then
    echo "Creating folder $i/../awstats";
    mkdir $i/../awstats
  fi

  if [ ! -d $i/../awstats/.data ]; then
    echo "Creating folder $i/../awstats/.data";
    mkdir $i/../awstats/.data
  fi

  if [ -d $i/../awstats/.data ]; then
    mv $i/awstats*.txt $i/../awstats/.data/
    # not sure if this is really necessary
    mv $i/dnscachelastupdate.*.txt $i/../awstats/.data
  else
    echo "Folder $i/../awstats/.data does not exist";
  fi
};
done;
 
How do I force the re-generation of awstats static pages ?

I am currently using the awstats directadmin installation.

I have updated the awstats.conf files of some domains to enable reverse DNS
but would like to see the results of my changes.
 
OK, I realized that I could use the command
/usr/local/directadmin/scripts/awstats_process.sh
to force the regeneration of updated awstats pages.

However I still don't know what to do to import the older data files
I have from an older installation. I tried moving my older files to the new data folder
/home/username/domains/domain/awstats/.data

But even if I executed the awstats_process.sh command, nothing changed.
what else can I do?
 
Back
Top