Script for monitoring logs

hi,
i'm using unix solaris 5.8. I have to write a shell script for monitoring logs. whenever the logs are not updated more than one hour an alert will be send to my mail. I'm new to Unix, so could anyone help me to find this.

ls -l gives you the last modification time of the log.
date takes format modifiers that return the current time any way you want it.
So a comparison of the last modified time with the current time is possibe in a shell script.

Alternatively Perl offers a stat function and a time function, both of which use epoch time and so a comparison is easier, ie.

 perl -e  '@file_detais=stat($ARGV[0]);print "Not changed in the last hour\n" if ((time() - ($file_details[9] + (60 * 60))) > 0); '  my_file.tmp

thanks for ur reply. Actually that comparision is the problem. The logs last updated time is like 10:30 but the system time is like 10:45:56, i can't able to find the difference. Could u pls help for this.

Check this thread. I wrote a script that basically does the same thing. If you have questions after going through the posts in that thread, do not hesitate to let me know and I'll be more than glad to help.