Server IP : 192.64.112.168 / Your IP : 3.137.200.56 Web Server : Apache System : Linux nc-ph-2300-85.bluforrest.com 4.18.0-513.9.1.el8_9.x86_64 #1 SMP Sat Dec 2 05:23:44 EST 2023 x86_64 User : expressoneac ( 1128) PHP Version : 8.0.30 Disable Function : exec,passthru,shell_exec,system MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /bin/ |
Upload File : |
#!/bin/bash # load sysconfig atop [ -f /etc/sysconfig/atop ] && . /etc/sysconfig/atop # Current Day format [ -z $CURDAY ] && CURDAY=`date +%Y%m%d` # Log files path [ -z $LOGPATH ] && LOGPATH=/var/log/atop # Binaries path [ -z $BINPATH ] && BINPATH=/usr/bin # PID File [ -z $PIDFILE ] && PIDFILE=/var/run/atop.pid # interval (default 10 minutes) [ -z $INTERVAL ] && INTERVAL=600 start_atop() { # start atop for all processes with interval of $INTERVAL # (by default 10) minutes $BINPATH/atop -a -w $LOGPATH/atop_$CURDAY $INTERVAL > $LOGPATH/atop.log 2>&1 & echo $! > $PIDFILE } # verify if atop still runs for daily logging # if [ -f $PIDFILE ]; then PID=`cat $PIDFILE` if [ -s $PIDFILE ] && ps -p $PID | grep 'atop$' > /dev/null then kill -USR1 $PID # take final sample sleep 3 kill -TERM $PID rm $PIDFILE sleep 1 else exit 1 fi fi start_atop exit 0