Avoid deleting log files for removed vhosts
authorclinton_admin <clinton_admin@navajos.hcoop.net>
Sun, 18 Aug 2013 20:06:18 +0000 (16:06 -0400)
committerclinton_admin <clinton_admin@navajos.hcoop.net>
Sun, 18 Aug 2013 20:06:18 +0000 (16:06 -0400)
* Not entirely certain this is the best behavior, but seems sensible
  so members don't accidentally lose their webalizer stats when
  reconfiguring a domain

apache-sync-logs

index 69095ed..58c24c5 100755 (executable)
@@ -69,7 +69,8 @@ for A in $(find $LOCAL_LOG_DIR -mindepth 3 -maxdepth 3 -print); do
         fi
         continue
     else
-       k5start -qtU -f $KEYTAB_DIR/$USER -- rsync -a --no-owner --no-group --delete $LOG_SRC/ $LOG_DEST/
+       # LOG_SRC/* is important: don't remove log files just because a vhost is gone
+       k5start -qtU -f $KEYTAB_DIR/$USER -- rsync -a --no-owner --no-group --delete $LOG_SRC/* $LOG_DEST/
        test "$VERBOSE" = "true" && echo "  done."
     fi
 done