Server IP : 104.244.120.118  /  Your IP : 216.73.216.198
Web Server : Apache
System : Linux ded5817.inmotionhosting.com 5.14.0-741.22.1.el9_9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Nov 12 14:34:46 UTC 2026 x86_64
User : persoanlinjuryla ( 1006)
PHP Version : 8.5.13
Disable Function : exec,passthru,shell_exec,system
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF
Directory (0555) :  /../../opt/dedrads/python/../python/../python/../python/../provision/../python/../

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //../../opt/dedrads/python/../python/../python/../python/../provision/../python/../lastcommcache.sh
#!/usr/bin/bash
# Shared RADS Tools, written by Erik Soroka (eriks@imhadmin.net, ext 834)
# this script gets executed by crontab to collect sa accounting data for use by RADS tools

#####################################################################
### COLLECT AND ARCHIVE PROCESS ACCOUNTING DATA HERE
#####################################################################

if [ -d /opt/sharedrads ]; then
    RECENTCP=/opt/sharedrads/recent-cp
else
    RECENTCP=/opt/dedrads/recent-cp
fi

if [ -f /var/log/sa/rads/.lastcomm.lock ]; then
        CHECKLOCK=$(find /var/log/sa/rads/.lastcomm.lock -mmin +2 -name "*" -print)

	if [ "$CHECKLOCK" == "" ]; then
                exit 0
        else
            	rm -f /var/log/sa/rads/.lastcomm.lock
        fi

fi

	touch /var/log/sa/rads/.lastcomm.lock
        echo -e "\033[40;37;2mCPU seconds for last 15m\033[0m" > /var/log/sa/rads/.lastcomm.cache
        $RECENTCP -n 10 2>/dev/null | grep -Ev 'root|total' | awk '{print $2,$9,$10,"("$11")"}' | sed s/\|//g | grep "%" | sort -r -nk2 >> /var/log/sa/rads/.lastcomm.cache
	mv -f /var/log/sa/rads/.lastcomm.cache /var/log/sa/rads/lastcomm.cache
	LINES=$(wc -l /var/log/sa/rads/lastcomm.cache | awk '{print $1}')

if [ "$LINES" == "1" ]; then
	echo -e "[\033[31;1m PSACCT IS DISABLED\033[0m ]" >> /var/log/sa/rads/lastcomm.cache
fi

rm -f /var/log/sa/rads/.lastcomm.lock

## EOF ##