]> granicus.if.org Git - sysstat/commit
Fix sar log file corruption in odd Feb 28th edge-case
authorSebastien GODARD <sysstat@orange.fr.fake>
Thu, 15 Aug 2013 14:20:12 +0000 (16:20 +0200)
committerSebastien GODARD <sysstat@orange.fr.fake>
Thu, 15 Aug 2013 14:20:12 +0000 (16:20 +0200)
commit4b06da42237b0c864c1c802c90163c3c1b5db50b
treea5a5e705a0ce0b240aba29be7611000ba3a69b3b
parent41d055ad4dbbb2eabe1f11c4947b028e5551c903
Fix sar log file corruption in odd Feb 28th edge-case

The sar scripts /usr/lib/sa/sa1 and sa2 both normally use logs in
/var/log/sa itself, but if HISTORY is > 28 , the scripts use a tree of
log directories under /var/log/sa.

When HISTORY is < 28, then /usr/lib/sa/sa2's action to expunge old logs
which are more than HISTORY days old will mean that "tomorrow's" saXX
file never exists prior to /usr/lib/sa/sa1 creating it on the first pass
of the day.

However, when HISTORY == 28, then on March 1st in a non-leap year, the
log file sa01 will already exist from Feb 1st having not been
pre-expunged by the sa2 script. Similarly for March 2nd through 28th.

So now make sure that the sa1 script deletes the log file
if it is from a previous month. This way this will
prevent a log file from a month ago being re-used "today".
sa1.in