Diff for /badi/public_scripts/awstats_update_all/awstats_update_all between versions 1.4 and 1.5

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

Removed from v.1.4  
changed lines
  Added in v.1.5


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>