Aix script to monitor when a file has been updated


 
Thread Tools Search this Thread
Operating Systems AIX Aix script to monitor when a file has been updated
# 1  
Old 03-19-2009
Aix script to monitor when a file has been updated

Hi

Im looking to create a Aix script to monitor a file for once it's been updated and then send an email. I dont have great scripting knowledge and have only come up with the following so far

while true
do
find /home/test/AMQ* -mmin 1 > /home/test/scripts/output/MQERRORS
exec /home/test/scripts/test
sleep 20
done

So from the above i can get the monitoring part done and am dealing with the email part in the script in the while loop in bold which i cant get to execute. Can you not execute a script in a while loop?

There is probably an easier way to do it, so some help would be much appreciated.

Thanks,

Matt.
# 2  
Old 03-19-2009
What for 'exec'.

while true
do
find /home/test/AMQ* -mmin 1 > /home/test/scripts/output/MQERRORS
/home/test/scripts/test
sleep 20
done


For run scheduling tasks cron is beter solutionSmilie
# 3  
Old 03-19-2009
Cheers for that looks like there was a problem with the test script i was tring to execute.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Post Here to Contact Site Administrators and Moderators

Need script to monitor open file in Linux

Kindly advice with shell script to monitor open file in linux, if the open file count is greater then 5000 then send me an email.. command : lsof | wc -l (0 Replies)
Discussion started by: adminhelp
0 Replies

2. Shell Programming and Scripting

Shell script to monitor new file in a directory and mail the file content

Hi I am looking for a help in designing a bash script on linux which can do below:- 1) Look in a specific directory for any new files 2) Mail the content of the new file Appreciate any help Regards Neha (5 Replies)
Discussion started by: neha0785
5 Replies

3. Shell Programming and Scripting

Script to monitor log file

Hi, Have written a script to monitor linux non standard log file based on line numbers, so each check store $otalinenum .. then in next check after 10 minutes it compre the current_total_line_num > last_total_line_num then it will parse the log file from last_total_line_num to... (0 Replies)
Discussion started by: Shirishlnx
0 Replies

4. Shell Programming and Scripting

Script to monitor a process and track status in a file

i have a scenario where i need a script that monitors a process "Monitor" based on process id... there can be any number of instances of this running... i start this across 4 servers in NFS. Now i need a file which has the process ids of the process that are currently in execution at any... (9 Replies)
Discussion started by: niteesh_!7
9 Replies

5. AIX

AIX ftp/sftp script monitor to failed logins

Hi All, Any idea on how to write a script on AIX 5.3 to monitor ftp or sftp login failed. Thanks and more power, Itik (2 Replies)
Discussion started by: itik
2 Replies

6. Shell Programming and Scripting

Script to send email if new file is added when folder is updated

Hi, I have a script which updates a repository which is run manually. When this happens either no or new files will be added to a specific folder. If there are new files that have been added, an email needs to be sent. How can i check a folder for any new files after the update repos script has... (0 Replies)
Discussion started by: acc01
0 Replies

7. Shell Programming and Scripting

Script to wait until file is updated

Hello, I need to evaluate (under BASH) if the certain file has been updated or not. If the file still wasn't updated, script should wait. The script picks up the time stamp of the file using command OldTimestamp=$(date -r $MyDir/$MyFile), but I don't know how to code a waiting loop with new and... (6 Replies)
Discussion started by: sameucho
6 Replies

8. Shell Programming and Scripting

Script to monitor the pattern in the log file

hi All, how to find a pattern in the log file & display the above and below line for example in the log file, i have many lines, whenever i search for "Category" it should display the above line with only few parameter like i want only the location name & department name Thu Jul 02 11:05:23... (2 Replies)
Discussion started by: rithick256
2 Replies

9. Shell Programming and Scripting

How do I get my script to monitor a new file using tail?

Hi, I have a script which basically watches a log file for new lines using tail, then takes action based on what is logged. I wrote a script to do this for me and its working great, my only problem is that once per week, this log file is archived to another directory, and a new log is created.... (4 Replies)
Discussion started by: lstorm2003
4 Replies
Login or Register to Ask a Question