1

My system is centos 7.4 with atop 2.3.0

I want to change atop log interval from default 600 to 300,then I vi /usr/share/atop/atop.daily as below:

#!/bin/bash

CURDAY=`date +%Y%m%d`
LOGPATH=/var/log/atop
BINPATH=/usr/bin
PIDFILE=/var/run/atop.pid
INTERVAL=600                            # interval 10 minutes

# support /etc/sysconfig/atop
source /etc/sysconfig/atop

I notice source /etc/sysconfig/atop,then I open /etc/sysconfig/atop:

CURDAY=`date +%Y%m%d`
# Log files path
LOGPATH=/var/log/atop
# Binaries path
BINPATH=/usr/bin
# PID File
PIDFILE=/var/run/atop.pid
# interval (default 10 minutes)
INTERVAL=600

Both files has INTERVAL=600,which file should be revised?

kittygirl
  • 855
  • 4
  • 10
  • 29
  • 1
    I assume as `INTERVAL` in `/etc/sysconfig/atop` is getting sourced _after_ the initial definition that the latter in `/etc/sysconfig/atop` would take precedence. Some tools use the first found directive, some tools use the last set directive (it is the default config file for atop, too). Also have a look here: https://serverfault.com/questions/790489/atop-configuration-file-location-on-centos-7-x – Lenniey Feb 28 '19 at 09:22

1 Answers1

-1
echo "LOGINTERVAL=60" >> /etc/sysconfig/atop

For Centos 7.

If you have a look at /usr/share/atop/atop.daily, it expects variable $LOGINTERVAL to be overriden