View Single Post

  #2 (permalink)  
Old 11-07-2006, 01:54 AM
rockdalinux's Avatar
rockdalinux rockdalinux is offline
Contributors
User
 
Join Date: May 2005
Location: Bangalore
My distro: RHEL, HP-UX, Solaris, FreeBSD, Ubuntu
Posts: 581
Rep Power: 7
rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough rockdalinux is a jewel in the rough
Default

Hmm

You need to store your inadyn.log log file current time somewhere. Then you can monitor current time and compare with stored location. If both differ restart the server.

Logic/script:
Code:
#!/bin/sh
file="/path/to/inadyn.log"
fileatime="/etc/current.time"
a=""
b=""
[ ! -f $fileatime ] && stat $file | grep Modify > $fileatime || :
[ -f $fileatime ] && a="$(cat $fileatime)" || exit 1
b="$(stat $file | grep Modify)"
if [ "$a" != "$b" ]; then
   echo "Restart server...."
   # update time
   stat $file | grep Modify > $fileatime 
fi
__________________
Rocky Jr.
You may have my body & soul, but you will never touch my pride!

If you have knowledge, let others light their candles at it.

Certified to work on HP-UX / Sun Solaris / RedHat
Reply With Quote