Bug 25590

Summary: cron.daily script not optimal in sysstat-3.3.3
Product: [Retired] Red Hat Linux Reporter: Stephen John Smoogen <smooge>
Component: sysstatAssignee: Preston Brown <pbrown>
Status: CLOSED DUPLICATE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: shishz
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-02-02 01:33:54 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Stephen John Smoogen 2001-02-02 01:33:49 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux 2.2.16-22smp i686; en-US; m18)
Gecko/20010131


The new sysstat cron script only documents 4 hours of data. This is because
sar starts from local 00:00 time on each report and the script is run at
04:00. The fix should be to run the sar command against the last days
logfile versus the current days. That will give a complete report of the
previous day

Reproducible: Always
Steps to Reproduce:
1.look at /var/log/sa/sarXX and see that report only covers 0400
2.
3.
	

The fix should be to run the sar command against the last days logfile
versus the current days. That will give a complete report of the
previous day. Below is the fixed script

#!/bin/sh
# /usr/lib/sa/sa2.sh
# (C) 1999,2000 Sebastien Godard <sebastien.godard>
#
S_TIME_FORMAT=ISO ; export S_TIME_FORMAT
DATE=`date +%d --date="yesterday"`
RPT=/var/log/sa/sar${DATE}
ENDIR=/usr/bin
DFILE=/var/log/sa/sa${DATE}
cd ${ENDIR}
${ENDIR}/sar $* -f ${DFILE} > ${RPT}
find /var/log/sa \( -name 'sar*' -o -name 'sa*' \) -mtime +7 -exec rm -f {} \;

Comment 1 Preston Brown 2001-02-02 23:06:03 UTC

*** This bug has been marked as a duplicate of 24820 ***