]> granicus.if.org Git - sysstat/commitdiff
Add sa2 option to avoid sarDD report generation
authorSebastien GODARD <sysstat@users.noreply.github.com>
Fri, 4 Sep 2015 08:11:17 +0000 (10:11 +0200)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Fri, 4 Sep 2015 08:11:17 +0000 (10:11 +0200)
There was no possibility to disable report generation without
modifying sa2 script.
So add a new variable (REPORTS) to sysstat configuration file which can
be set to false to disable reports generation.
Close #81.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
sa2.in
sysstat.sysconfig.in

diff --git a/sa2.in b/sa2.in
index 6cbca7150b6dad72ed968b8690d95381d31d7a36..32d29f3aceb78a8eabfb58623714246fd6d6ddff 100644 (file)
--- a/sa2.in
+++ b/sa2.in
@@ -43,7 +43,10 @@ ENDIR=@bindir@
 
 [ -f "${DFILE}" ] || exit 0
 cd ${ENDIR}
-${ENDIR}/sar $* -f ${DFILE} > ${RPT}
+if [ x${REPORTS} != xfalse ]
+then
+       ${ENDIR}/sar $* -f ${DFILE} > ${RPT}
+fi
 
 SAFILES_REGEX='/sar?[0-9]{2,8}(\.(Z|gz|bz2|xz|lz|lzo))?$'
 
index 29f3542d115b742d210b5449f46169c91183a62d..fc7c7dd60529452b7d55af852d7764e4d97af18e 100644 (file)
@@ -22,3 +22,7 @@ ZIP="@ZIP@"
 # usually runs right after midnight. If you want sa2 to generate the summary
 # of the same day (for example when cron job runs at 23:53) set this variable.
 #YESTERDAY=no
+
+# By default sa2 script generates reports files (the so called sarDD files).
+# Set this variable to false to disable reports generation.
+#REPORTS=false