]> granicus.if.org Git - sysstat/commit
sadc now overwrites its daily data file when it is from a previous month.
authorSebastien Godard <sysstat@orange.fr>
Tue, 8 May 2012 13:12:15 +0000 (15:12 +0200)
committerSebastien Godard <sysstat@orange.fr>
Tue, 8 May 2012 13:12:15 +0000 (15:12 +0200)
commit0aced09880c724952a02b86fdaf142b01e1bc988
tree70424408756a74202cae87abf65c5e67f32940c9
parent521c8f731f4b4fe7e9375e83d6c4f8d2383a96a8
sadc now overwrites its daily data file when it is from a previous month.

When the output file is specified as "-", sadc now overwrites the daily
data file if it is from a previous month. This is useful to prevent data
from several months from being saved in the same file.

Mail from Vitezslav Cizek <vcizek@suse.cz>:

Hi,
/var/log/sa/saXX files don't get overwritten when new month comes.
The new data is appended to the end.
Reproduced with several versions of sysstat.

I browsed the code, but couldn't find any part relevant
to the date checking when opening files.

It works as advertised in manpage with the attached patch.
(Against 10.0.4)

The patch doesn't check whether it operates on the standard file or not.
CHANGES
CREDITS
man/sadc.in
sadc.c