source: BAORadio/AmasNancay/submit2bqs-scaextractor.sh @ 510

Last change on this file since 510 was 510, checked in by campagne, 13 years ago

change scriptpath (general) + minor things

File size: 1.6 KB
Line 
1#!/bin/sh -xvf
2DATE=/bin/date
3GREP=/bin/grep
4AWK=/bin/awk
5ECHO=/bin/echo
6WC=/usr/bin/wc
7CAT=/bin/cat
8PRINTF=/usr/bin/printf
9FIND=/usr/bin/find
10MKDIR=/bin/mkdir
11XARGS=/usr/bin/xargs
12SORT=/bin/sort
13RM=/bin/rm
14TR=/usr/bin/tr
15CP=/bin/cp
16LS=/bin/ls
17CHMOD=/bin/chmod
18
19#Process cmd line args: the -src option is mandatory (source name as Abell85)
20sourceRadio=
21while [ $# -gt 0 ]
22do
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
32done
33
34#Path to public backupable path
35publicpath="/afs/in2p3.fr/home/c/campagne/public"
36
37
38#temporary files to synchronize scripts
39tmppublicpath="/sps/baoradio/AmasNancay"
40$LS -l ${tmppublicpath} > /dev/null
41
42#Path of the utility scripts
43scriptpath="/afs/in2p3.fr/home/c/campagne/private/work/AmasNancay"
44
45#the daq current irod status
46tag=`${DATE} +%F`
47OUT1=${publicpath}/baodaqstatus-${tag}.txt
48
49if [ ! -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} 
59fi
60
61jobBatchName="scaMaker-$sourceRadio"
62jobLogName="${jobBatchName}.log.$$"
63
64qsub -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
66EOF
Note: See TracBrowser for help on using the repository browser.