Hey guys
Just need some help with crontab.Iam looking for a script that will alert particular user about its change through sendmail.We are using bash here.
--CoolKid
Hey guys
Just need some help with crontab.Iam looking for a script that will alert particular user about its change through sendmail.We are using bash here.
--CoolKid
I'm sure there are many ways to do it. One would be to watch the MD5 of the file, and send a mail when it changes.
ORIGMD5=`crontab -l | md5sum`
while ( true )
do
NEWMD5=`crontab -l | md5sum`
if [[ "$ORIGMD5" != "$NEWMD5" ]]
then
echo "crontab changed" | mail you@example.com
ORIGMD5=$NEWMD5
fi
sleep 60
done
Thank You PXT.
do we have to include the path as well of the sendmail for a group of users