Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
General
cancel
Showing results for 
Search instead for 
Did you mean: 

Regardnig log rotation period of /var/log/sa folder.

Minoru Asano
Frequent Advisor

Regardnig log rotation period of /var/log/sa folder.

Hello,

I would like to know how to change log rotation period of /var/log/sa log.

[ENVIRONMENT]
RHEL 3 ES up6

[SITUATION]
At /var/log/sa directory, some file remain for 7 days.

[QUESTION]
- How can I change the log rotation at /var/log/sa directory ?
What shall I do to change the period of log retention in it ?
I could not find any setting at /etc/crontab, etc.


Thank you for advice.
Best Regards.
/Minoru

2 REPLIES
Luk Vandenbussche
Honored Contributor

Re: Regardnig log rotation period of /var/log/sa folder.

I would not do this.
Normally there is one file for each day of the month.

The files are used to collect statistics of your server with the command sar.

So you can have statistics of the last month
Ralph Grothe
Honored Contributor

Re: Regardnig log rotation period of /var/log/sa folder.

I presume your sar tool installation came as part of the sysstat rpm.
You can simply query for the config files.

# rpm -qc sysstat
/etc/cron.d/sysstat
/etc/sysconfig/sysstat

The first most likely is a Vixie-type crontab
For instance on this Fedora box the sar is scheduled like this.
Simply change the time for the summary collecting.

# cat /etc/cron.d/sysstat
# run system activity accounting tool every 10 minutes
*/10 * * * * root /usr/lib/sa/sa1 1 1
# generate a daily summary of process accounting at 23:53
53 23 * * * root /usr/lib/sa/sa2 -A


How many generations you wish to keep
seems to be configured here on RH.

# cat /etc/sysconfig/sysstat
# How long to keep log files (days), maximum is a month
HISTORY=7


Madness, thy name is system administration