You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@community.apache.org by se...@apache.org on 2016/02/13 10:46:38 UTC

svn commit: r1730171 - /comdev/reporter.apache.org/trunk/scripts/svnadd.sh

Author: sebb
Date: Sat Feb 13 09:46:37 2016
New Revision: 1730171

URL: http://svn.apache.org/viewvc?rev=1730171&view=rev
Log:
Create current and cumulative logs

Modified:
    comdev/reporter.apache.org/trunk/scripts/svnadd.sh

Modified: comdev/reporter.apache.org/trunk/scripts/svnadd.sh
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/scripts/svnadd.sh?rev=1730171&r1=1730170&r2=1730171&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/scripts/svnadd.sh (original)
+++ comdev/reporter.apache.org/trunk/scripts/svnadd.sh Sat Feb 13 09:46:37 2016
@@ -17,8 +17,18 @@ BASE=$(basename $SVNDIR)
 
 YYMM=$(date '+%Y-%m')
 
-exec  >>${LOGDIR}/${BASE}_${YYMM}.log
+# Create the cumulative log dir if necessary
+ARCHIVE_DIR=${LOGDIR}/${YYMM}
+test -d ${ARCHIVE_DIR} || mkdir ${ARCHIVE_DIR}
 
+ARCHIVE_NAME=${BASE}_${YYMM}.log
+
+# Move any existing cumulative log to the correct place:
+test -f ${LOGDIR}/${ARCHIVE_NAME} && mv ${LOGDIR}/${ARCHIVE_NAME} ${ARCHIVE_DIR}/${ARCHIVE_NAME}
+
+# Create cumulative log in subdirectory
+exec  >>${ARCHIVE_DIR}/${ARCHIVE_NAME}
+{
 svn status $SVNDIR | awk '/^\? / {print $2}' | xargs -r svn add | \
 {
     # Read one line first
@@ -41,3 +51,5 @@ svn status $SVNDIR | awk '/^\? / {print
         echo '<<<'
     }
 }
+} | tee ${LOGDIR}/${BASE}.log
+# and last log in main directory
\ No newline at end of file