It might be necessary to save sar reports longer than 7 days. This post explains the steps to achieve this goal.
The “sa2” is the script that is responsible for writing a summarized daily activity report. The /usr/lib/sa/sa2 has the following entries:
#!/sbin/sh # Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T # All Rights Reserved # THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T # The copyright notice above does not evidence any # actual or intended publication of such source code. #ident "@(#)sa2.sh 1.4 98/03/26 SMI" /* SVr4.0 1.4 */ # sa2.sh 1.4 of 5/8/89 DATE=`/usr/bin/date +%d` RPT=/var/adm/sa/sar$DATE DFILE=/var/adm/sa/sa$DATE ENDIR=/usr/bin cd $ENDIR $ENDIR/sar $* -f $DFILE > $RPT /usr/bin/find /var/adm/sa \( -name 'sar*' -o -name 'sa*' \) -mtime +7 -exec /usr/bin/rm {} \;
The “-mtime +7” entry shows that it can only keep 7 days of sar report. Changing the value to something else will keep the record longer than 7 days.
Once done modifying the file, refresh your sar SMF service via:
# svcadm refresh svc:/system/sar:default