Gander
Verified User
Source: I have existing awstats folders in my Users public_html folders. I need to make them links
My Script:
After awstats / webalizer instalation and before run this script, you should execute as root this commands:
please, someone pro check this?
I used this on my server, and all is look good.
My Script:
Code:
#!/bin/sh
STATS_LIST="stats awstats"
for html in `ls -d /home/*/domains/*/public_html`; do
{
echo
for stat in $STATS_LIST; do
{
if [ ! -e "$html/../$stat" ]; then
echo "$html/../$stat not exists, skipping";
continue;
elif [ -h "$html/$stat" ]; then
echo "$html/$stat is a link, skipping";
else
echo "creating link: $html/$stat";
rm -rf "$html/$stat"
ln -s "../$stat" "$html/$stat"
fi
for sub in `ls $html/../$stat/`; do
{
if [ -d "$html/../$stat/$sub" ]; then
if [ ! -e "$html/$sub" -o ! -d "$html/$sub" ]; then
echo "$html/$sub not exists or not dir, skipping"
elif [ -h "$html/$sub/$stat" ]; then
echo "$html/$sub/$stat is a link, skipping";
else
echo "creating link: $html/$sub/$stat";
rm -rf "$html/$sub/$stat"
ln -s "../../$stat" "$html/$sub/$stat"
fi
fi
};
done;
};
done;
};
done;
After awstats / webalizer instalation and before run this script, you should execute as root this commands:
Code:
echo 'action=tally&value=all' >> /usr/local/directadmin/data/task.queue
/usr/local/directadmin/dataskq d
please, someone pro check this?
I used this on my server, and all is look good.
Last edited: