-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathmakebatchdir.sh
More file actions
executable file
·39 lines (29 loc) · 933 Bytes
/
makebatchdir.sh
File metadata and controls
executable file
·39 lines (29 loc) · 933 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/bash
echo "[INFO] Creating and preparing batch subdir"
# creo la cartella
mkdir batch/
# creo il il base_script
base=./batch/base_script
cat > $base <<EOF
#!/bin/bash
# this is the directory from which the job has been launched
cd $PWD
export SCRAM_ARCH=$SCRAM_ARCH
eval \`scramv1 runtime -sh\`
# return to the working dir on the batch machine
cd -
cp $PWD/batch/$analysis.tar ./
tar -xf $analysis.tar
mkdir -p ./output
# do not put exit 0 at the end of the script since it is sourced by other scripts
EOF
if [ ! -e "$HOME/bin/base_output.sh" ];then
echo "base_output.sh not found in $HOME/bin/" > /dev/stderr
echo "please ask shervin@cern.ch the base_output.sh file" > /dev/stderr
exit 1
fi
cp $HOME/bin/base_output.sh ./batch/
# copy the launching script in the batch directory
cp ./script/start.sh ./batch/
# copy the analysis script to be executed on the batch host
cp ./script/$analysis.sh ./batch/