/logrotate.d/psaccu_atop

http://github.com/brinkman83/bashrc · #! · 24 lines · 23 code · 1 blank · 0 comment · 0 complexity · c6faf9502219f8f6628ff37374f699e6 MD5 · raw file

  1. # Logrotate file to take action after psacct is rotated
  2. /var/log/atop/dummy_after {
  3. missingok
  4. daily
  5. rotate 1
  6. ifempty
  7. create 0600 root root
  8. postrotate
  9. if [ -e /etc/logrotate.d/psacct ]
  10. then
  11. # if the atop daemon does not run, restart it after
  12. # accounting file is rotated
  13. PIDFILE=/var/run/atop.pid
  14. if [ -e $PIDFILE ] && \
  15. ps -p `cat $PIDFILE` | grep 'atop$' > /dev/null
  16. then
  17. :
  18. else
  19. /etc/atop/atop.daily
  20. fi
  21. fi
  22. endscript
  23. }