![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | 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 and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Alert Patrol | bighand42 | HP-UX | 2 | 10-15-2008 10:57 AM |
| File Modified : Alert me | StrengthThaDon | UNIX for Dummies Questions & Answers | 6 | 04-08-2008 03:23 PM |
| If any file resides for more than an hour in this directory then to raise an alert | yazhini.t | Shell Programming and Scripting | 2 | 12-03-2007 10:40 PM |
| sendmail alert msg- How to | roncayenne | UNIX for Dummies Questions & Answers | 1 | 08-09-2005 07:04 PM |
| ALERT!!! ALERT!!! I messed up the UNIX!!! | Fwurm | UNIX for Dummies Questions & Answers | 15 | 11-06-2001 05:53 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
File alert
Hi friends
I have configuration files in one directory. I want to get an alert if any of the existing files gets modified or any new configuration file is present in the directory. Please help me to design a script for this task. Thanks in advance. John |
|
|||||
|
There are different approaches possible for sure. One could be to get a kind of snapshot of the files you want to observe, maybe by the tool cksum and write that snapshot in some tmp file. Then, by cron, trigger that script every 10 minutes or whatever interval you'd like and get a new snap and compare it to the former snap in the temp file. If there is a difference, send a mail.
Code:
man cksum man mail cron and crontab For if/then/fi and tests etc., have a look at this maybe too: Advanced Bash-Scripting Guide If you encounter a special problem, feel free to ask. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|