PageRenderTime 72ms CodeModel.GetById 50ms app.highlight 1ms RepoModel.GetById 19ms app.codeStats 1ms

/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
15	    if [ -e $PIDFILE ] && \
16			ps -p `cat $PIDFILE` | grep 'atop$' > /dev/null
17	    then
18	        :
19	    else
20	        /etc/atop/atop.daily
21	    fi
22	fi
23    endscript
24}