[ale] file modification time via shell script

Jim Popovitch yahoo at jimpop.com
Fri Aug 3 21:21:41 EDT 2007


Thanks for all the replies, here is what I came up with:

--- bof -----
1:  #!/bin/bash
2:  
3:  LOGFILE=/var/mailman/logs/smtp.log
4:  LOCKFILE=/var/mailman/locks/mailman-archive-to-rss.lock
5:  
6:  if [ -e $LOCKFILE ]; then exit; fi
7:  
8:  touch $LOCKFILE
9:  
10: NEW=`find $LOGFILE -mmin 1 -print`
11: 
12: if [ "$NEW" != "" ]; then
13:          /usr/local/mailman/bin/mailman-archive-to-rss
14: fi
15: 
16: rm -f $LOCKFILE
--- eof -----

Assumptions:

- This script runs every minute from cron
- smtp.log exists
- userid running script has permission to execute mailman-archive-to-rss
- userid running script has permission to write $LOCKFILE

Questions:

1) Should I be concerned about dead time between line 6 and line 7?

2) Should I be concerned about -mmin on line 10?

Thx,

-Jim P.




More information about the Ale mailing list