11#! /bin/bash
22clear
3- location=" /afs/cern.ch/user/j/jartieda/MonitoringScripts/Pledges_View_SSB/prod_cores"
3+ location=" /afs/cern.ch/user/c/cmst1/scratch0/MonitoringScripts/Pledges_View_SSB/prod_cores"
4+ outputdir=" /afs/cern.ch/user/c/cmst1/www/SST"
45cd $location
56# Email if things are running slowly
67if [ -f scriptRunning.run ];
78then
8- echo " run_prodcores.sh is already running. Will send an email to the admin."
9- # script to send simple email
10- # email subject
11- SUBJECT=" [ Prod[Cores]] load Prod[Cores] "
12- # Email To ?
13- 14- # Email text/message
15- if [ -f emailmessage.txt ];
16- then
17- rm emailmessage.txt
18- fi
19- touch emailmessage.txt
20- EMAILMESSAGE=" /tmp/emailmessage.txt"
21- echo " run_prodcores.sh is running to slowly. "
22- # send an email using /bin/mail
23- /bin/mail -s " $SUBJECT " " $EMAIL " < $EMAILMESSAGE
24-
9+ echo " run_prodcores.sh is already running. Will send an email to the admin."
10+ # script to send simple email
11+ # email subject
12+ SUBJECT=" Prod[Cores] running slowly "
13+ # Email To ?
14+ 15+ # Email text/message
16+ if [ -f emailmessage.txt ];
17+ then
18+ rm emailmessage.txt
19+ fi
20+ touch emailmessage.txt
21+ EMAILMESSAGE=" /tmp/emailmessage.txt"
22+ echo " run_prodcores.sh is stuck!! " > $EMAILMESSAGE
23+ echo $location >> $EMAILMESSAGE
24+ # send an email using /bin/mail
25+ /bin/mail -s " $SUBJECT " " $EMAIL " < $EMAILMESSAGE
2526else
26- echo " bash run_prodcores.sh succesfully"
27- touch scriptRunning.run
27+ echo " bash run_prodcores.sh started succesfully"
28+ touch scriptRunning.run
2829fi
2930
30-
3131# Run the script
3232txt=" prod"
3333echo " python prodcores.py"
@@ -37,7 +37,7 @@ problem="$?"
3737echo " problem: $problem "
3838echo " The files were created succesfully."
3939
40- cp $txt " .txt" /afs/cern.ch/user/c/cmst1/www/SST
41- cp $txt " .json" /afs/cern.ch/user/c/cmst1/www/SST
40+ cp $txt " .txt" $outputdir
41+ cp $txt " .json" $outputdir
4242
43- rm scriptRunning.run
43+ rm scriptRunning.run
0 commit comments