File alert


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting File alert
# 1  
Old 01-21-2009
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
# 2  
Old 01-21-2009

man find

Look for the -newer operand.
# 3  
Old 01-21-2009
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

For questions regarding cron, look here:
https://www.unix.com/answers-frequent...n-crontab.html

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.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Cybersecurity

**ALERT**ALERT* Whats app requesting users to upgrade to latest version as; its vulnerability found.

Hello All, Want to share here an article for Whats app users that team whats app is requesting users to upgrade to its latest version since they have found a vulnerability; where Hacker could turn on a cell's camera, mic and scan messages and emails. Here is an article from "THE VERGE" for... (1 Reply)
Discussion started by: RavinderSingh13
1 Replies

2. Shell Programming and Scripting

File monitor and alert

whats is the best way to monitor file if it has not updated in last 24 hours. example /var/logmessages in linux , /var/adm/messaged in solaris and alert to email . find with mtime , perl file stat, anyone have any script examples of something better ? (3 Replies)
Discussion started by: nixguynj
3 Replies

3. Shell Programming and Scripting

Alert for missing file in directory

Deleting code (6 Replies)
Discussion started by: Adfire
6 Replies

4. Shell Programming and Scripting

File size alert

Hello, I want to check the size of text files in a directory continuously via cronjob. I would like to receive an e-mail alert if the file is greater than 0 kb. Thank you for your help. (3 Replies)
Discussion started by: hoo
3 Replies

5. Shell Programming and Scripting

Script to Alert a file and sends an email

Hello All, I need a script which alerts me when a files arrive in a directory. I don't need every file. but i need some specific pattern file. And i need to get automatic email gettin as an alert For Example: /a/b/c/ : directory format of file should take regualr expression or manually... (2 Replies)
Discussion started by: krux_rap
2 Replies

6. Shell Programming and Scripting

Script check for file, alert if not there, and continue checking until file arrives

All, Is there a way to keep checking for a file over and over again in the same script for an interval of time? Ie If { mail -user continue checking until file arrives file arrives tasks exit I don't want the script to run each time and email the user each time a file... (4 Replies)
Discussion started by: markdjones82
4 Replies

7. Shell Programming and Scripting

file old than 10 mins to alert

Hello We have to monitor a FTP utility where we have to monitor for checking presence of a file in directory With max time allowed for a file to stay in the directory on FTP client server as 10 mins. The only way we are going to be able to do what we are lookign for is to write a script to... (1 Reply)
Discussion started by: vivkas
1 Replies

8. Shell Programming and Scripting

File system backup alert

Hi All, OS: AIX 5.3 64 bits Could anyone please share unix File system backup alert shell script which sends an alert message upon failure.. Thanks for your time! Regards, (0 Replies)
Discussion started by: a1_win
0 Replies

9. UNIX for Dummies Questions & Answers

File Modified : Alert me

I would like to alert myself when a file has been modified using a script but im not sure where to begin the only command i can think to use is the touch command (6 Replies)
Discussion started by: StrengthThaDon
6 Replies

10. UNIX for Dummies Questions & Answers

ALERT!!! ALERT!!! I messed up the UNIX!!!

Hello If you want a short description read my last thread! I have no root access anymore. No remote access! By user access i get a programm started and when i close it, i got logged off! So I guess I messed up the passwd file! is there a chance of booting a unix system (SCO-UNIX UnixWare... (15 Replies)
Discussion started by: Fwurm
15 Replies
Login or Register to Ask a Question