[PC-BSD Commits] r14045 - pcbsd/current/src-sh/pc-metapkgmanager

svn at pcbsd.org svn at pcbsd.org
Mon Nov 28 09:10:23 PST 2011


Author: kris
Date: 2011-11-28 09:10:23 -0800 (Mon, 28 Nov 2011)
New Revision: 14045

Modified:
   pcbsd/current/src-sh/pc-metapkgmanager/pc-metapkgmanager
Log:

Only remove metapkgmanager log if over 5MB




Modified: pcbsd/current/src-sh/pc-metapkgmanager/pc-metapkgmanager
===================================================================
--- pcbsd/current/src-sh/pc-metapkgmanager/pc-metapkgmanager	2011-11-28 16:14:42 UTC (rev 14044)
+++ pcbsd/current/src-sh/pc-metapkgmanager/pc-metapkgmanager	2011-11-28 17:10:23 UTC (rev 14045)
@@ -342,7 +342,12 @@
 
 # Create the logfile
 create_logfile() {
-	if [ -e "${LOGFILE}" ] ; then rm ${LOGFILE} ; fi
+	if [ -e "${LOGFILE}" ]; then
+		# Rotate the log file if over 5 MB
+ 		if [ `du -m ${LOGFILE} | awk '{print $1}'` -gt 5 ]; then
+			rm ${LOGFILE}
+		fi
+	fi
 	touch ${LOGFILE}
 	chmod 666 ${LOGFILE}
 }



More information about the Commits mailing list