|

Sys Admin and The Perl
Journal CD-ROM version 12.0
Version 12.0 delivers every issue of Sys Admin from 1992 through 2006 and every
issue of The Perl Journal from 1996-2002 in one convenient CD-ROM!
Order now! |
|
 |
|
 |
Listing 1 stop_cron
#!/bin/sh
# Listing 1: stop_cron
. /etc/setenv_path
users=$@
if [ -z "$users" ]
then
while read user
do
users="$users $user"
done
fi
CRON_ALLOW=/etc/cron.d/cron.allow
SORTINGHAT_DIR=/opt/SortingHat
for user in $users
do
if grep -w $user $CRON_ALLOW
then
echo "Stopping ${user}'s cron..."
file=/var/spool/cron/crontabs/$user
if [ -f $file ]
then
$SORTINGHAT_DIR/bin/SortingHat -b $file
fi
crontab -r $user
echo "${user}'s cron has been stopped."
else
echo "$user is not in $CRON_ALLOW"
fi
done
|
|
 |
|
|
|