Chkallusrcron

From brokenpoet.org wiki

This is a basic bash script to check the cron jobs of all users on a system.

Must be run as a user with root privileges.



wget http://scripts.brokenpoet.org/chkallusrcron.sh



#!/bin/bash
# Created by Benjamin Cathey 2008.02.29 14:00 

a=$(cat /etc/passwd | cut -d: -f1)
for i in $a
do
 b=$(crontab -u $i -l 2>$|wc -l)
 if [ $b != 0 ]
 then
   echo -e "\E[31m<<--------------------------->>"
   echo -e "\E[34m\033[1m"$i"'s cron entries\033[0m"
   tput sgr0
   echo ""
   crontab -u $i -l
   echo -e "\E[31m<<--------------------------->>"
   echo ""
   tput sgr0

 fi      
done
Personal tools