• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How To Increase The Retention Of “sar” Data To ‘N’ Days in Linux

by admin

The system performance is constantly monitored by the sysstat tools. Performance logs are not retained for as long a time as desired. This post outlines steps to increase the retention of sar data to the desired number of days.

How To Change The Performance Log Retaining Period

Logs are kept for a period of days. Edit the file /etc/sysconfig/sysstat so that the HISTORY value indicates the desired number of days for keeping the performance logs:

$ cat etc/sysconfig/sysstat
# sysstat-9.0.4 configuration file.

# How long to keep log files (in days).
# If value is greater than 28, then log files are kept in
# multiple directories, one for each month.
HISTORY=28

# Compress (using gzip or bzip2) sa and sar files older than (in days):
COMPRESSAFTER=31

# Parameters for the system activity data collector (see sadc manual page)
# which are used for the generation of log files.
SADC_OPTIONS="-S DISK"

The setting becomes active immediately and will be used for automated sar daily processing.

How To Reduce Disk Space

The COMPRESSAFTER setting, as shown in the above code snippet, will automatically compress performance data older than a given number of days.

How To Collect Optional Performance Categories

In addition to the built-in performance statistics, the sysstat subsystem has a number of optional statistic stats which can be enabled. Please refer to the sadc (system activity data collector) manual page to see the current optional statistic sets available.

# man sadc

Filed Under: Linux

Some more articles you might also be interested in …

  1. caja: command not found
  2. chrt Command Examples in Linux
  3. How to work with multiple java versions under Linux
  4. gzip: command not found
  5. ‘lxc_cgfs – Device or resource busy – failed to set memory.use_hierarchy to 1; continuing’ – error while starting LXC container
  6. groupdel: command not found
  7. How to change the PATH variable in Linux
  8. flashrom Command Examples in Linux
  9. printf: command not found
  10. CentOS/RHEL: Mount Command Fails With “mount: does not contain SELinux labels”

You May Also Like

Primary Sidebar

Recent Posts

  • raw: command not found
  • raw Command Examples in Linux
  • rankmirrors Command Examples in Linux
  • radeontop: command not found

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright