From Gary Ballantine, 5 Years ago, written in Bash.
Embed
  1. #!/bin/bash
  2.  
  3. filemtime=$(cat /root/lockmtime)
  4. lockmtime=$(stat -c %y /net/jh-na02/vol/Blackboard_NFS/opt/blackboard/content/vi/bb_bb60/activemq/messageQueueService/kaha/lock)
  5.  
  6. echo $lockmtime > /root/lockmtime2
  7.  
  8. if [  "$filemtime" != "$lockmtime" ]
  9. then
  10.         echo "Multiple MyBU Server are attempting to create the lock file (/net/jh-na02/vol/Blackboard_NFS/opt/blackboard/content/vi/bb_bb60/activemq/messageQueueService/kaha/lock) please investigate." |mailx -s "MyBU Lock File" -r noreply@bournemouth.ac.uk gballantine@bournemouth.ac.uk csenior@bournemouth.ac.uk tteng@bournemouth.ac.uk jcooper@bournemouth.ac.uk
  11. fi