--- badi/public_scripts/awstats_update_all/awstats_update_all 2010/08/31 01:55:03 1.4 +++ badi/public_scripts/awstats_update_all/awstats_update_all 2013/11/28 10:12:57 1.5 @@ -6,7 +6,7 @@ # 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. +# (c) 2010 under GPL v2 by Adrian Zaugg. # awstats main script @@ -21,16 +21,16 @@ CONF_EXT="conf" # File to exclude # Exclude this file, which isn't a config file for awstats, but # also resides in the config directory. Note: Only -# files with an extension $CONF_EXT are considered anyway. +# files with an extension $CONF_EXT are considered anyway. CONF_TEMPLATE="awstats.default" # Run with this priority (0: normal - 19: friendly) -NICENESS=16 +NICENESS=19 # Maximum awstats update processes to run at once MAX_PROCESSES=8 -# Wait that many seconds when MAX_PROCESSES are running +# Wait that many seconds when MAX_PROCESSES are running # to retry starting new update processes RETRY=2 @@ -51,7 +51,7 @@ function count_proc() { function do_update() { # call awstats - if $SPEAK; then + if $SPEAK; then nice -n "$NICENESS" "$AWSTATS_BIN" -update -config="$site" & else # Print errors only @@ -67,7 +67,7 @@ cd "$CONF_DIR" for conf in *.$CONF_EXT; do notstarted=true - + # control number uf update processes while [ $notstarted = true ]; do count_proc @@ -94,7 +94,7 @@ cd "$CURRENT_DIR" count_proc if [ $COUNT_PROC -gt 0 ]; then $SPEAK && echo "`date "+%Y-%m-%d %H:%M:%S"`: All jobs started - $COUNT_PROC process(es) still runnning. Waiting..." - + # wait for processes to finish while [ $COUNT_PROC -gt 0 ]; do sleep "$RETRY"