version 1.2, 2010/07/31 11:54:46
|
version 1.3, 2010/08/01 19:33:20
|
Line 1
|
Line 1
|
#!/bin/sh |
#!/bin/sh |
|
|
|
|
# Update all awstats sites there is a config file for |
# Update all awstats sites there is a config file for |
|
# This script runs awstats -update for all sites a config file |
|
# exists in the awstats config dir. It runs the update process in parallel |
|
# for several sites at once. Give the command line argument "-q" to suppress |
|
# all but error output. |
|
|
|
# (c) 2010 under GPL v2 by Adrian Zaugg. |
|
|
|
|
AWSTATS_BIN="/usr/lib/cgi-bin/awstats.pl" |
AWSTATS_BIN="/usr/lib/cgi-bin/awstats.pl" |
CONF_DIR="/etc/awstats" |
CONF_DIR="/etc/awstats" |
|
|
|
# file to exclude |
CONF_TEMPLATE="awstats.default" |
CONF_TEMPLATE="awstats.default" |
|
|
|
# normal awstats config files have this extension |
CONF_EXT="conf" |
CONF_EXT="conf" |
|
|
|
# Run with this priority |
NICENESS=16 |
NICENESS=16 |
|
|
|
# maximum awstats update processes to run at once |
MAX_PROCESSES=8 |
MAX_PROCESSES=8 |
|
|
# Wait that many seconds when MAX_PROCESSES are COUNT_PROC |
# Wait that many seconds when MAX_PROCESSES are COUNT_PROC |
# to retry starting new update processes |
# to retry starting new update processes |
RETRY=2 |
RETRY=2 |
|
|
|
|
|
|
# ----don't edit below this line----- |
# ----don't edit below this line----- |
|
|
# default to babbly, -q suppress output |
# default to babbly, -q suppress output |
SPEAK=true |
SPEAK=true |
|
|
if [ "$1" = "-q" ]; then |
if [ "$1" = "-q" ]; then |
SPEAK=false |
SPEAK=false |
fi |
fi |
|
|
function count_proc() { |
function count_proc() { |
# count how many instances are already running |
# count how many instances are already COUNT_PROC |
COUNT_PROC=$(ps -o command -u "$(id -u)" | egrep -cwe '^(/bin/sh|/usr/bin/perl)* *'"$AWSTATS_BIN") |
COUNT_PROC=$(ps -o command -u "$(id -u)" | egrep -cwe '^(/bin/sh|/usr/bin/perl)* *'"$AWSTATS_BIN") |
} |
} |
|
|