Skip to main content

In RH/CentOS atop is not being regulated by logrotate.

In /usr/share/atop/atop.daily there is an example script to deal with atop log file rotation.

The script as a find line deleting logs older than 28 days as in:

# delete logfiles older than four weeks
# start a child shell that activates another child shell in
# the background to avoid a zombie
#
( (sleep 3; find $LOGPATH -name 'atop_*' -mtime +28 -exec rm {} \;)& )

You can copy that script to /etc/cron.daily and change the number of days to 5.

( (sleep 3; find $LOGPATH -name 'atop_*' -mtime +5 -exec rm {} \;)& )

Dealing with daily files can also be a bit inconvenient. Using the above script, if you do not intend in doing a pure daily rotation, you can also edit /etc/sysconfig/atop and change the duration, for instance for 10 minutes, as in:

INTERVAL=600

As an alternative, if you do want to keep rotating it daily, you can create a logrotate file at /etc/logrotate.d/atop as in:

/var/log/atop/atop_201[0atop_20[0-9][0-9][0-9][0-9][0-9][0-9] {
    missingok
    daily
    nodateext
    rotate 5
    ifempty
    nocreate
    postrotate
      /usr/bin/find /var/log/atop/ -maxdepth 1 -mount -name atop_201\[0atop_20\[0-9\]\[0-9\]\[0-9\]\[0-9\]\[0-9\]\[0-9\]\* -mtime +40 -exec /bin/rm {} \;
    endscript
    }

If you are doing the logrotate version, you need to keep the daily files, and do not change the INTERVAL parameter.

In RH/CentOS atop is not being regulated by logrotate.

In /usr/share/atop/atop.daily there is an example script to deal with atop log file rotation.

The script as a find line deleting logs older than 28 days as in:

# delete logfiles older than four weeks
# start a child shell that activates another child shell in
# the background to avoid a zombie
#
( (sleep 3; find $LOGPATH -name 'atop_*' -mtime +28 -exec rm {} \;)& )

You can copy that script to /etc/cron.daily and change the number of days to 5.

( (sleep 3; find $LOGPATH -name 'atop_*' -mtime +5 -exec rm {} \;)& )

Dealing with daily files can also be a bit inconvenient. Using the above script, if you do not intend in doing a pure daily rotation, you can also edit /etc/sysconfig/atop and change the duration, for instance for 10 minutes, as in:

INTERVAL=600

As an alternative, if you do want to keep rotating it daily, you can create a logrotate file at /etc/logrotate.d/atop as in:

/var/log/atop/atop_201[0-9][0-9][0-9][0-9][0-9] {
    missingok
    daily
    nodateext
    rotate 5
    ifempty
    nocreate
    postrotate
      /usr/bin/find /var/log/atop/ -maxdepth 1 -mount -name atop_201\[0-9\]\[0-9\]\[0-9\]\[0-9\]\[0-9\]\* -mtime +40 -exec /bin/rm {} \;
    endscript
    }

If you are doing the logrotate version, you need to keep the daily files, and do not change the INTERVAL parameter.

In RH/CentOS atop is not being regulated by logrotate.

In /usr/share/atop/atop.daily there is an example script to deal with atop log file rotation.

The script as a find line deleting logs older than 28 days as in:

# delete logfiles older than four weeks
# start a child shell that activates another child shell in
# the background to avoid a zombie
#
( (sleep 3; find $LOGPATH -name 'atop_*' -mtime +28 -exec rm {} \;)& )

You can copy that script to /etc/cron.daily and change the number of days to 5.

( (sleep 3; find $LOGPATH -name 'atop_*' -mtime +5 -exec rm {} \;)& )

Dealing with daily files can also be a bit inconvenient. Using the above script, if you do not intend in doing a pure daily rotation, you can also edit /etc/sysconfig/atop and change the duration, for instance for 10 minutes, as in:

INTERVAL=600

As an alternative, if you do want to keep rotating it daily, you can create a logrotate file at /etc/logrotate.d/atop as in:

/var/log/atop/atop_20[0-9][0-9][0-9][0-9][0-9][0-9] {
    missingok
    daily
    nodateext
    rotate 5
    ifempty
    nocreate
    postrotate
      /usr/bin/find /var/log/atop/ -maxdepth 1 -mount -name atop_20\[0-9\]\[0-9\]\[0-9\]\[0-9\]\[0-9\]\[0-9\]\* -mtime +40 -exec /bin/rm {} \;
    endscript
    }

If you are doing the logrotate version, you need to keep the daily files, and do not change the INTERVAL parameter.

deleted 11 characters in body
Source Link
Rui F Ribeiro
  • 58k
  • 28
  • 156
  • 238

In RH/CentOS atop is not being regulated by logrotate.

In /usr/share/atop/atop.daily there is an example script to deal with atop log file rotation.

The script as a find line deleting logs older than 28 days as in:

# delete logfiles older than four weeks
# start a child shell that activates another child shell in
# the background to avoid a zombie
#
( (sleep 3; find $LOGPATH -name 'atop_*' -mtime +28 -exec rm {} \;)& )

You can copy that script to /etc/cron.daily and change the number of days to 5.

( (sleep 3; find $LOGPATH -name 'atop_*' -mtime +5 -exec rm {} \;)& )

Dealing with daily files can also be a bit inconvenient. Using the above script, if you do not intend in doing a pure daily rotation, you can also edit /etc/sysconfig/atop and change the duration, for instance for 10 minutes, as in:

INTERVAL=600

As an alternative, if you do want to keep rotating it daily via syslog, you can create a logrotate file at /etc/logrotate.d/atop as in:

/var/log/atop/atop_201[0-9][0-9][0-9][0-9][0-9] {
    missingok
    daily
    nodateext
    rotate 5
    ifempty
    nocreate
    postrotate
      /usr/bin/find /var/log/atop/ -maxdepth 1 -mount -name atop_201\[0-9\]\[0-9\]\[0-9\]\[0-9\]\[0-9\]\* -mtime +40 -exec /bin/rm {} \;
    endscript
    }

If you are doing the logrotate version, you need to keep the daily files, and do not change the INTERVAL parameter.

In RH/CentOS atop is not being regulated by logrotate.

In /usr/share/atop/atop.daily there is an example script to deal with atop log file rotation.

The script as a find line deleting logs older than 28 days as in:

# delete logfiles older than four weeks
# start a child shell that activates another child shell in
# the background to avoid a zombie
#
( (sleep 3; find $LOGPATH -name 'atop_*' -mtime +28 -exec rm {} \;)& )

You can copy that script to /etc/cron.daily and change the number of days to 5.

( (sleep 3; find $LOGPATH -name 'atop_*' -mtime +5 -exec rm {} \;)& )

Dealing with daily files can also be a bit inconvenient. Using the above script, if you do not intend in doing a pure daily rotation, you can also edit /etc/sysconfig/atop and change the duration, for instance for 10 minutes, as in:

INTERVAL=600

As an alternative, if you do want to keep rotating it daily via syslog, you can create a logrotate file at /etc/logrotate.d/atop as in:

/var/log/atop/atop_201[0-9][0-9][0-9][0-9][0-9] {
    missingok
    daily
    nodateext
    rotate 5
    ifempty
    nocreate
    postrotate
      /usr/bin/find /var/log/atop/ -maxdepth 1 -mount -name atop_201\[0-9\]\[0-9\]\[0-9\]\[0-9\]\[0-9\]\* -mtime +40 -exec /bin/rm {} \;
    endscript
    }

If you are doing the logrotate version, you need to keep the daily files, and do not change the INTERVAL parameter.

In RH/CentOS atop is not being regulated by logrotate.

In /usr/share/atop/atop.daily there is an example script to deal with atop log file rotation.

The script as a find line deleting logs older than 28 days as in:

# delete logfiles older than four weeks
# start a child shell that activates another child shell in
# the background to avoid a zombie
#
( (sleep 3; find $LOGPATH -name 'atop_*' -mtime +28 -exec rm {} \;)& )

You can copy that script to /etc/cron.daily and change the number of days to 5.

( (sleep 3; find $LOGPATH -name 'atop_*' -mtime +5 -exec rm {} \;)& )

Dealing with daily files can also be a bit inconvenient. Using the above script, if you do not intend in doing a pure daily rotation, you can also edit /etc/sysconfig/atop and change the duration, for instance for 10 minutes, as in:

INTERVAL=600

As an alternative, if you do want to keep rotating it daily, you can create a logrotate file at /etc/logrotate.d/atop as in:

/var/log/atop/atop_201[0-9][0-9][0-9][0-9][0-9] {
    missingok
    daily
    nodateext
    rotate 5
    ifempty
    nocreate
    postrotate
      /usr/bin/find /var/log/atop/ -maxdepth 1 -mount -name atop_201\[0-9\]\[0-9\]\[0-9\]\[0-9\]\[0-9\]\* -mtime +40 -exec /bin/rm {} \;
    endscript
    }

If you are doing the logrotate version, you need to keep the daily files, and do not change the INTERVAL parameter.

added 123 characters in body
Source Link
Rui F Ribeiro
  • 58k
  • 28
  • 156
  • 238

In RH/CentOS atop is not being regulated by logrotate.

In /usr/share/atop/atop.daily there is an example script to deal with atop log file rotation.

The script as a find line deleting logs older than 28 days as in:

# delete logfiles older than four weeks
# start a child shell that activates another child shell in
# the background to avoid a zombie
#
( (sleep 3; find $LOGPATH -name 'atop_*' -mtime +28 -exec rm {} \;)& )

You can copy that script to /etc/cron.daily and change the number of days to 5.

( (sleep 3; find $LOGPATH -name 'atop_*' -mtime +5 -exec rm {} \;)& )

Dealing with daily files can also be a bit inconvenient.

If Using the above script, if you do not intend in doing a pure daily rotation, you can also edit /etc/sysconfig/atop and change the duration, for instance for 10 minutes, as in:

INTERVAL=600

As an alternative, if you do want to keep rotating it daily via syslog, you can create a logrotate file at /etc/logrotate.d/atop as in:

/var/log/atop/atop_201[0-9][0-9][0-9][0-9][0-9] {
    missingok
    daily
    nodateext
    rotate 5
    ifempty
    nocreate
    postrotate
      /usr/bin/find /var/log/atop/ -maxdepth 1 -mount -name atop_201\[0-9\]\[0-9\]\[0-9\]\[0-9\]\[0-9\]\* -mtime +40 -exec /bin/rm {} \;
    endscript
    }

If you are doing the logrotate version, you need to keep the daily files, and do not change the INTERVAL parameter.

In RH/CentOS atop is not being regulated by logrotate.

In /usr/share/atop/atop.daily there is an example script to deal with atop log file rotation.

The script as a find line deleting logs older than 28 days as in:

# delete logfiles older than four weeks
# start a child shell that activates another child shell in
# the background to avoid a zombie
#
( (sleep 3; find $LOGPATH -name 'atop_*' -mtime +28 -exec rm {} \;)& )

You can copy that script to /etc/cron.daily and change the number of days to 5.

( (sleep 3; find $LOGPATH -name 'atop_*' -mtime +5 -exec rm {} \;)& )

Dealing with daily files can also be a bit inconvenient.

If you do not intend in doing a pure daily rotation, you can also edit /etc/sysconfig/atop and change the duration, for instance for 10 minutes, as in:

INTERVAL=600

As an alternative, if you do want to keep rotating it daily via syslog, you can create a logrotate file at /etc/logrotate.d/atop as in:

/var/log/atop/atop_201[0-9][0-9][0-9][0-9][0-9] {
    missingok
    daily
    nodateext
    rotate 5
    ifempty
    nocreate
    postrotate
      /usr/bin/find /var/log/atop/ -maxdepth 1 -mount -name atop_201\[0-9\]\[0-9\]\[0-9\]\[0-9\]\[0-9\]\* -mtime +40 -exec /bin/rm {} \;
    endscript
    }

If you are doing the logrotate version, you need to keep the daily files, and do not change the INTERVAL parameter.

In RH/CentOS atop is not being regulated by logrotate.

In /usr/share/atop/atop.daily there is an example script to deal with atop log file rotation.

The script as a find line deleting logs older than 28 days as in:

# delete logfiles older than four weeks
# start a child shell that activates another child shell in
# the background to avoid a zombie
#
( (sleep 3; find $LOGPATH -name 'atop_*' -mtime +28 -exec rm {} \;)& )

You can copy that script to /etc/cron.daily and change the number of days to 5.

( (sleep 3; find $LOGPATH -name 'atop_*' -mtime +5 -exec rm {} \;)& )

Dealing with daily files can also be a bit inconvenient. Using the above script, if you do not intend in doing a pure daily rotation, you can also edit /etc/sysconfig/atop and change the duration, for instance for 10 minutes, as in:

INTERVAL=600

As an alternative, if you do want to keep rotating it daily via syslog, you can create a logrotate file at /etc/logrotate.d/atop as in:

/var/log/atop/atop_201[0-9][0-9][0-9][0-9][0-9] {
    missingok
    daily
    nodateext
    rotate 5
    ifempty
    nocreate
    postrotate
      /usr/bin/find /var/log/atop/ -maxdepth 1 -mount -name atop_201\[0-9\]\[0-9\]\[0-9\]\[0-9\]\[0-9\]\* -mtime +40 -exec /bin/rm {} \;
    endscript
    }

If you are doing the logrotate version, you need to keep the daily files, and do not change the INTERVAL parameter.

added 123 characters in body
Source Link
Rui F Ribeiro
  • 58k
  • 28
  • 156
  • 238
Loading
added 473 characters in body
Source Link
Rui F Ribeiro
  • 58k
  • 28
  • 156
  • 238
Loading
added 235 characters in body
Source Link
Rui F Ribeiro
  • 58k
  • 28
  • 156
  • 238
Loading
added 41 characters in body
Source Link
Rui F Ribeiro
  • 58k
  • 28
  • 156
  • 238
Loading
Source Link
Rui F Ribeiro
  • 58k
  • 28
  • 156
  • 238
Loading