|
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/../perl/../python/../python/../ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
#!/usr/bin/bash
#load functions + banners
if [ -f /opt/sharedrads/radsfunctions.sh ]; then
source /opt/sharedrads/radsfunctions.sh
else
source /opt/dedrads/radsfunctions.sh
fi
CHECKUSER=$1
SESSIONID=$2
function pusage(){
echo
echo "Usage:"
echo " check_crons [username] - displays the crontab file for a user"
echo " check_crons --recent - count frequency of recent cron executions"
echo " check_crons --full - print last 50000 lines of cron log sorted by user"
echo
}
if [ -z $1 ]; then
pusage
exit;
fi
if [ "$1" == "--help" ];then
pusage
exit;
fi
if [ "$1" == "--full" ];then
echo "Displaying the last 50000 lines of /var/log/cron sorted by user:"
echo
sudo tail -50000 /var/log/cron | sort -k6
exit;
fi
if [ "$1" == "--recent" ];then
echo "Displaying users with the most cronjob executions as found in /var/log/cron:"
echo
sudo cat /var/log/cron | awk '{print $6}' | sort | uniq -c | sort -nk1
exit;
fi
if [ -z $2 ]; then
SESSIONID=`date +%s`
DETAILED=YES
fi
EMPTY=NO
cat /var/spool/cron/$CHECKUSER 1> /tmp/.$SESSIONID 2> /dev/null || EMPTY=TRU
if [ "$EMPTY" == "NO" ];
then
echo
echo -e "\033[40;37;2m RADS has detected these custom cron jobs currently enabled for this account \033[0m"
if [ "$RADSCOLORS" == "off" ];
then
echo -en "\033[0m"
else
echo -en "\033[29;30;1m"
fi
#displays crons
cat /tmp/.$SESSIONID
echo
#clear colors
echo -en "\033[0m"
fi
#no session ID was received earlier, we were invoked directly, lets display add'l history:
if [ "$DETAILED" == "YES" ]; then
echo -e "\033[40;37;2m Displaying cron execution history for user's scheduled jobs \033[0m"
if [ "$RADSCOLORS" == "off" ];
then
echo -e "\033[0m"
else
echo -e "\033[34;1m"
fi
grep $CHECKUSER /var/log/cron
echo -ne "\033[0m"
rm -f /tmp/.$SESSIONID
fi