Package: sysstat
Version: 5.0.6-5

Sysstat enforces a 7-day limit on the time for which performance data is
kept.  On production systems a longer period is desirable.  The attached
patches (to /etc/default/sysstat and /usr/lib/sysstat/sa2, respectively)
implement this functionality.

-- 
Paul
<http://paulgear.webhop.net>
--- sysstat	2005/06/09 20:30:33	1.2
+++ sysstat	2005/06/09 20:57:05
@@ -1,5 +1,6 @@
 #
-# Default settings for /etc/init.d/sysstat and /etc/cron.d/sysstat
+# Default settings for /etc/init.d/sysstat, /etc/cron.d/sysstat, and
+# /usr/lib/sysstat/sa2
 #
 
 # Should sadc collect system activity informations? Valid values
@@ -10,3 +11,10 @@
 # Options passed to sadc in the /etc/init.d/sysstat script.
 # See sadc(8) for more information
 OPTIONS="-F -L -"
+
+# The number of days for which to keep sysstat performance logs.  If set to
+# less than 1, no performance logs will be removed, and files will be
+# overwritten on the like-numbered day of the next month.  Setting this
+# greater than 31 will have no effect (unless sysstat has not been running
+# for some reason).  If not set, defaults to 7 days.
+#KEEP_DAYS=0
--- sa2	2005/06/09 20:29:46	1.2
+++ sa2	2005/06/09 20:54:39
@@ -5,11 +5,14 @@
 S_TIME_FORMAT=ISO ; export S_TIME_FORMAT
 umask 0022
 DATE=`date  +%d`
+KEEP_DAYS=7
+[ -f /etc/default/sysstat ] && . /etc/default/sysstat
 RPT=/var/log/sysstat/sar${DATE}
 ENDIR=/usr/bin
 DFILE=/var/log/sysstat/sa${DATE}
 [ -f "$DFILE" ] || exit 0
 cd ${ENDIR}
 ${ENDIR}/sar.sysstat $* -f ${DFILE} > ${RPT}
-find /var/log/sysstat \( -name 'sar??' -o -name 'sa??' \) -mtime +7 -exec rm -f {} \;
-
+if [ "${KEEP_DAYS}" -gt 0 ]; then
+	find /var/log/sysstat \( -name 'sar??' -o -name 'sa??' \) -mtime +${KEEP_DAYS} -exec rm -f {} \;
+fi

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to