1 | #!/bin/sh -xvf |
---|
2 | DATE=/bin/date |
---|
3 | GREP=/bin/grep |
---|
4 | AWK=/bin/awk |
---|
5 | ECHO=/bin/echo |
---|
6 | WC=/usr/bin/wc |
---|
7 | CAT=/bin/cat |
---|
8 | PRINTF=/usr/bin/printf |
---|
9 | FIND=/usr/bin/find |
---|
10 | MKDIR=/bin/mkdir |
---|
11 | XARGS=/usr/bin/xargs |
---|
12 | SORT=/bin/sort |
---|
13 | RM=/bin/rm |
---|
14 | TR=/usr/bin/tr |
---|
15 | CP=/bin/cp |
---|
16 | LS=/bin/ls |
---|
17 | CHMOD=/bin/chmod |
---|
18 | |
---|
19 | #Process cmd line args: the -src option is mandatory (source name as Abell85) |
---|
20 | sourceRadio= |
---|
21 | while [ $# -gt 0 ] |
---|
22 | do |
---|
23 | case "$1" in |
---|
24 | -src) sourceRadio=$2; shift;; |
---|
25 | -h) |
---|
26 | echo >&2 \ |
---|
27 | "usage: $0 -src souce" |
---|
28 | exit 1;; |
---|
29 | *) break;; # terminate while loop |
---|
30 | esac |
---|
31 | shift |
---|
32 | done |
---|
33 | |
---|
34 | #Path to public backupable path |
---|
35 | publicpath="/afs/in2p3.fr/home/c/campagne/public" |
---|
36 | |
---|
37 | |
---|
38 | #temporary files to synchronize scripts |
---|
39 | tmppublicpath="/sps/baoradio/AmasNancay" |
---|
40 | $LS -l ${tmppublicpath} > /dev/null |
---|
41 | |
---|
42 | #Path of the utility scripts |
---|
43 | scriptpath="/afs/in2p3.fr/home/c/campagne/private/work/AmasNancay" |
---|
44 | |
---|
45 | #the daq current irod status |
---|
46 | tag=`${DATE} +%F` |
---|
47 | OUT1=${publicpath}/baodaqstatus-${tag}.txt |
---|
48 | |
---|
49 | if [ ! -e ${OUT1} -o ! -r ${OUT1} ]; then |
---|
50 | $ECHO "We should bring the DAQ status more up to date, this take 1 or 2sec..." |
---|
51 | $RM -f ${tmppublicpath}/statusdaq.finished |
---|
52 | ${scriptpath}/statusdaq.sh > ${OUT1} |
---|
53 | while [ ! -f "${tmppublicpath}/statusdaq.finished" ]; do |
---|
54 | sleep 30 |
---|
55 | done |
---|
56 | $RM ${tmppublicpath}/statusdaq.finished |
---|
57 | #protect against remove/rewriting |
---|
58 | $CHMOD -v 444 ${OUT1} |
---|
59 | fi |
---|
60 | |
---|
61 | jobBatchName="scaMaker-$sourceRadio" |
---|
62 | jobLogName="${jobBatchName}.log.$$" |
---|
63 | |
---|
64 | qsub -l u_sps_baoradio,u_irods,T=100000,M=256MB,scratch=700MB,platform=LINUX -eo -o $jobLogName -N $jobBatchName -mb -me -mu campagne@lal.in2p3.fr <<EOF |
---|
65 | /afs/in2p3.fr/home/c/campagne/private/work/AmasNancay/scaextractor.sh $sourceRadio |
---|
66 | EOF |
---|