* [Alain Chereau]: Options -g and -T added to iostat. These
options enable the user to display statistics for groups of
devices.
+ * [Vitezslav Cizek]: sadc now overwrites its standard daily
+ data file when this file is from a past month.
* sadf: Change time format from HH-MM-SS to HH:MM:SS in the
various reports displayed by sadf.
* XSD document updated: Added a maxOccurs indicator for the
timestamp element.
* [Peter Schiffer]: Set exit code to 0 for sa2 shell script.
- * iostat manual page updated.
+ * iostat and sadc manual pages updated.
* CREDITS file updated.
2012/03/07: Version 10.0.4 - Sebastien Godard (sysstat <at> orange.fr)
Xavier Bru <xavier.bru@bul[...].net>
Jason Burnett <jason@jnj[...].org>
Fabricio Ceolin <ceolin@ule[...].com
+ Vitezslav Cizek <vcizek@sus[...].cz>
Mark J. Cox <mjc@red[...].com>
Jean Dagenais <jean.dagenais@int[...].com>
Nicolas Denis <denisn@wan[...].fr>
-.TH SADC 8 "SEPTEMBER 2010" Linux "Linux User's Manual" -*- nroff -*-
+.TH SADC 8 "MAY 2012" Linux "Linux User's Manual" -*- nroff -*-
.SH NAME
sadc \- System activity data collector.
.SH SYNOPSIS
uses the standard system activity daily data file, the
.IR @SA_DIR@/sa dd
file, where the dd parameter indicates the current day.
+In this case,
+.B sadc
+will overwrite the file if it is from a previous month.
By default
.B sadc
collects all the data available from the kernel.
{
struct file_magic file_magic;
struct file_activity file_act;
+ struct tm rectime;
ssize_t sz;
int i, p;
handle_invalid_sa_file(ofd, &file_magic, ofile, 0);
}
+ /*
+ * If we are using the standard daily data file (file specified
+ * as "-" on the command line) and it is from a past month,
+ * then overwrite (truncate) it.
+ */
+ get_time(&rectime);
+
+ if (((file_hdr.sa_month != rectime.tm_mon) ||
+ (file_hdr.sa_year != rectime.tm_year)) &&
+ WANT_SA_ROTAT(flags)) {
+ close(*ofd);
+ create_sa_file(ofd, ofile);
+ return;
+ }
+
/*
* OK: It's a true system activity file.
* List of activities from the file prevails over that of the user.