Initial add of defaria.com
[clearscm.git] / defaria.com / Computers / code / adm / bin / monitor_taskbroker
1 #!/bin/bash
2 ################################################################################
3 #
4 # File:         monitor_taskbroker
5 # Description:  Quick script to monitor the taskbroker/build pool
6 # Author:       Andrew DeFaria (defaria@cup.hp.com)
7 # Language:     Korn Shell
8 # Modified::
9 #
10 # (c) Copyright 2001, Andrew@DeFaria.com, all rights reserved
11 #
12 ################################################################################
13 me=$(basename $0)
14
15 integer day_of_week=$(date +%w)
16 integer sleep_time=5*60
17
18 talktotaskbroker=/usr/eclipse/etc/talktotaskbroker
19 logfile=/tmp/taskbroker$day_of_week.log
20
21 function get_status {
22   print "At $(date)"
23   $talktotaskbroker mstatus
24 } # get_status
25
26 rm -f $logfile
27
28 print "$me started"
29 while true; do
30   if [ $day_of_week -ne $(date +%w) ]; then
31     day_of_week=$(date +%w)
32     logfile_old=$logfile
33     logfile=/tmp/taskbroker$day_of_week.log
34     print "Continuing in $logfile..." >> $logfile_old
35   fi
36
37   get_status >> $logfile
38   sleep $sleep_time
39 done &