6b782c
diff -ur sysstat-10.1.5.orig/man/sysstat.in sysstat-10.1.5/man/sysstat.in
6b782c
--- sysstat-10.1.5.orig/man/sysstat.in	2010-09-22 22:07:29.000000000 +0200
6b782c
+++ sysstat-10.1.5/man/sysstat.in	2014-09-01 22:50:58.614499671 +0200
6b782c
@@ -11,17 +11,99 @@
6b782c
 configure sysstat logging.
6b782c
 The variables and their meanings are:
6b782c
 .TP
6b782c
+.B COMPRESSAFTER
6b782c
+Number of days after which daily data files are to be compressed.
6b782c
+The compression program is given in the
6b782c
+.B ZIP
6b782c
+variable.
6b782c
+
6b782c
+.TP
6b782c
 .B HISTORY
6b782c
 The number of days during which a daily data file or a report
6b782c
 should be kept. Data files or reports older than this number of
6b782c
 days will be removed by the
6b782c
 .BR sa2 (8)
6b782c
 shell script.
6b782c
+Data files and reports are normally saved in the @SA_DIR@ directory,
6b782c
+under the name
6b782c
+.IR saDD
6b782c
+(for data files) or
6b782c
+.IR sarDD
6b782c
+(for reports), where the DD parameter indicates the current day.
6b782c
 
6b782c
-.TP
6b782c
-.B COMPRESSAFTER
6b782c
-Number of days after which daily data files are to be compressed,
6b782c
-either by gzip or bzip2.
6b782c
+The number of files actually kept in the @SA_DIR@ directory may be
6b782c
+slightly higher than the
6b782c
+.B HISTORY
6b782c
+value due to the way the
6b782c
+.B sa2
6b782c
+script figures
6b782c
+out which files are to be removed (see below "How the
6b782c
+.BR sa2 (8)
6b782c
+script applies
6b782c
+.B HISTORY
6b782c
+value"). Using a value of 28 keeps a whole month's worth of data.
6b782c
+
6b782c
+How the
6b782c
+.BR sa2 (8)
6b782c
+script applies
6b782c
+.B HISTORY
6b782c
+value
6b782c
+
6b782c
+The
6b782c
+.B sa2
6b782c
+script uses the "find" command with the "-mtime" option to figure
6b782c
+out which files are to be removed. The "find" command interprets this value
6b782c
+as "N 24 hour periods", ignoring any fractional part. This means that the
6b782c
+last modified time of a given sa[r]DD data or report file, using a
6b782c
+.B HISTORY
6b782c
+of 1, has to have been modified at least two days ago before it will be
6b782c
+removed. And for a
6b782c
+.B HISTORY
6b782c
+of 28 that would mean 29 days ago.
6b782c
+
6b782c
+To figure out how a
6b782c
+.B HISTORY
6b782c
+of 28 is applied in practice, we need to
6b782c
+consider that the
6b782c
+.B sa2
6b782c
+script that issues the "find" command to remove the
6b782c
+old files typically runs just before mid-night on a given system, and since
6b782c
+the first record from
6b782c
+.B sadc
6b782c
+can also be written to the previous day's data file
6b782c
+(thereby moving its modification time up a bit), the
6b782c
+.B sa2
6b782c
+script will leave
6b782c
+30 files untouched. So for a setting of 28, and counting the data file of
6b782c
+the current day, there will always be 31 files (or 30 files, depending on the
6b782c
+number of days in a month) in the @SA_DIR@ directory during the majority
6b782c
+of a given day.  E.g.:
6b782c
+
6b782c
+April 30th: 31 files (Apr 30th-1st, Mar 31th)
6b782c
+.br
6b782c
+May 1st: 30 files (May 1st, Apr 30th-2nd)
6b782c
+
6b782c
+Yet we can note the following exceptions (as inspected at Noon of the given
6b782c
+day):
6b782c
+
6b782c
+February 28th: 31 files (Feb 28th-1st, Jan 31st, 30th & 29th)
6b782c
+.br
6b782c
+March 1st: 30 files (Mar 1st, Feb 28th-2nd, Jan 31st & 30th)
6b782c
+.br
6b782c
+March 2nd: 29 files (Mar 1st & 2nd, Feb 28th-3rd, Jan. 31st)
6b782c
+.br
6b782c
+March 3rd: 28 files (Mar 1st-3rd, Feb 28th-4th)
6b782c
+.br
6b782c
+March 4th - March 28th: 28 files
6b782c
+.br
6b782c
+March 29th: 29 files
6b782c
+.br
6b782c
+March 30th: 30 files
6b782c
+.br
6b782c
+March 31st: 31 files
6b782c
+
6b782c
+(Determining the number of files in March on a leap year is left as an
6b782c
+exercise for the reader).
6b782c
 
6b782c
 .TP
6b782c
 .B SADC_OPTIONS
6b782c
@@ -34,6 +116,10 @@
6b782c
 These options are used only when a new data file is created. They will be
6b782c
 ignored with an already existing one.
6b782c
 
6b782c
+.TP
6b782c
+.B ZIP
6b782c
+Program used to compress data and report files.
6b782c
+
6b782c
 .SH FILES
6b782c
 .IR @SYSCONFIG_DIR@/sysstat
6b782c