![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Problem with Cron Email Notification | sasaliasim | AIX | 1 | 04-29-2008 09:02 AM |
| Counting Files and send an email Notification if it exceeds a limit | amitsayshii | UNIX for Dummies Questions & Answers | 10 | 07-07-2006 07:25 AM |
| How to add email notification in scripts? | redlotus72 | UNIX for Dummies Questions & Answers | 2 | 03-14-2005 05:19 AM |
| Why am I not recieving email notification? | Kelam_Magnus | Post Here to Contact Site Administrators and Moderators | 6 | 09-03-2002 07:01 PM |
| email notification if job is killed/dies | jacob_gs | Shell Programming and Scripting | 2 | 05-15-2002 11:29 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Crontab change and email notification
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 |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
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.
Code:
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
|
|
#3
|
|||
|
|||
|
Thank You PXT.
|
|
#4
|
|||
|
|||
|
do we have to include the path as well of the sendmail for a group of users
Last edited by coolkid; 01-02-2008 at 01:17 PM. |
|||
| Google The UNIX and Linux Forums |