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

man find

Look for the -newer operand.

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.

man cksum
man mail

For questions regarding cron, look here:

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.