apache-sync-logs: Skip people who have unreadable log subdirectories.
authormwolson_admin <mwolson_admin@deleuze.hcoop.net>
Tue, 18 Dec 2007 21:31:42 +0000 (16:31 -0500)
committermwolson_admin <mwolson_admin@deleuze.hcoop.net>
Tue, 18 Dec 2007 21:31:42 +0000 (16:31 -0500)
apache-sync-logs

index fdc2919..b3d1ab2 100755 (executable)
@@ -24,8 +24,9 @@ chmod -R u=rwX,g=rX,o=X $LOCAL_LOG_DIR
 for A in $(find $LOCAL_LOG_DIR -mindepth 3 -maxdepth 3 -print); do
     USER=`basename $A`
     PATHBITS=`echo $USER | head -c 1`/`echo $USER | head -c 2`/$USER
 for A in $(find $LOCAL_LOG_DIR -mindepth 3 -maxdepth 3 -print); do
     USER=`basename $A`
     PATHBITS=`echo $USER | head -c 1`/`echo $USER | head -c 2`/$USER
+    USER_HOME=$AFS_USER_DIR/$PATHBITS
     LOG_SRC=$A/apache/log
     LOG_SRC=$A/apache/log
-    LOG_DEST=$AFS_USER_DIR/$PATHBITS/.logs/apache/
+    LOG_DEST=$USER_HOME/.logs/apache/
     TMP_DEST=$LOG_SRC.tmp
 
     # Skip deleted or empty log directories
     TMP_DEST=$LOG_SRC.tmp
 
     # Skip deleted or empty log directories
@@ -33,6 +34,12 @@ for A in $(find $LOCAL_LOG_DIR -mindepth 3 -maxdepth 3 -print); do
         continue
     fi
 
         continue
     fi
 
+    # Skip people who have unreadable log subdirectories
+    if test -d "$USER_HOME/.logs" && \
+        ! ls "$USER_HOME/.logs" >/dev/null 2>&1; then
+        continue
+    fi
+
     # Skip people who do not have keytabs
     if test ! -f "$KEYTAB_DIR/$USER"; then
         continue
     # Skip people who do not have keytabs
     if test ! -f "$KEYTAB_DIR/$USER"; then
         continue