CE-cms-dummy 1.27 KB
Newer Older
Stefano Belforte's avatar
Stefano Belforte committed
1
#!/bin/sh
Stefano Belforte's avatar
Stefano Belforte committed
2
echo "<pre>"
Stefano Belforte's avatar
Stefano Belforte committed
3
set -x
Stefano Belforte's avatar
Stefano Belforte committed
4
5
pid=$$;
ppid=`ps -oppid --no-headers -p ${pid}` 
Stefano Belforte's avatar
Stefano Belforte committed
6

Stefano Belforte's avatar
Stefano Belforte committed
7
8
9
10
11
12
13
14
15
pid=${ppid}
ppid=`ps -oppid --no-headers -p ${pid}`
command=`ps -ocommand --no-headers -p ${pid}`
while ! echo ${command} | grep 'UI=000000'; do
  pid=${ppid}
  [ ${pid} -ne 0 ] || break;
  ppid=`ps -oppid --no-headers -p ${pid}`
  command=`ps -ocommand --no-headers -p ${pid}`
done
Stefano Belforte's avatar
Stefano Belforte committed
16

Stefano Belforte's avatar
Stefano Belforte committed
17
jw_file=`echo ${command} | awk '{print $2}'`
Stefano Belforte's avatar
Stefano Belforte committed
18

Stefano Belforte's avatar
Stefano Belforte committed
19
20
21
echo \$jw_file = $jw_file
ls -l $jw_file
#cat $jw_file
Stefano Belforte's avatar
Stefano Belforte committed
22

Stefano Belforte's avatar
Stefano Belforte committed
23
cp $jw_file ./JobWrapper
Stefano Belforte's avatar
Stefano Belforte committed
24

Stefano Belforte's avatar
Stefano Belforte committed
25
26
27
grep jobid_to_filename JobWrapper|head -1
grep maradona= JobWrapper
grep ce_application_dir JobWrapper |head -1
Stefano Belforte's avatar
Stefano Belforte committed
28

Stefano Belforte's avatar
Stefano Belforte committed
29
30
31
32
jobid_to_filename=`grep jobid_to_filename JobWrapper|head -1|cut -d= -f2|tr -d \"`
maradonaFile=${jobid_to_filename}.output
ls -l ${maradonaFile}
ce_application_dir=`grep ce_application_dir JobWrapper |head -1|cut -d= -f2|tr -d \"`
Stefano Belforte's avatar
Stefano Belforte committed
33

Stefano Belforte's avatar
Stefano Belforte committed
34
35
36
echo " "
echo "================================================="
echo " "
Stefano Belforte's avatar
Stefano Belforte committed
37

Stefano Belforte's avatar
Stefano Belforte committed
38
39
40
41
42
43
44
echo \$ce_application_dir = $ce_application_dir
echo \$maradonaFile = $maradonaFile
echo \$VO_CMS_SW_DIR = $VO_CMS_SW_DIR
ls -ld ${ce_application_dir}/
ls -ld ${ce_application_dir}/cms
ls -l ${ce_application_dir}/lcg-jobwrapper-hook.sh
ls -l ${ce_application_dir}/cms/lcg-jobwrapper-hook.sh
Stefano Belforte's avatar
Stefano Belforte committed
45

Stefano Belforte's avatar
Stefano Belforte committed
46
#cat $maradonaFile
Stefano Belforte's avatar
Stefano Belforte committed
47

Stefano Belforte's avatar
Stefano Belforte committed
48

Stefano Belforte's avatar
Stefano Belforte committed
49
tar czf tutto.tgz . --exclude test.out 
Stefano Belforte's avatar
Stefano Belforte committed
50

Stefano Belforte's avatar
Stefano Belforte committed
51
set +x
Stefano Belforte's avatar
Stefano Belforte committed
52

Stefano Belforte's avatar
Stefano Belforte committed
53
echo "</pre>"
Stefano Belforte's avatar
Stefano Belforte committed
54

Stefano Belforte's avatar
Stefano Belforte committed
55
exit $SAME_OK