-
Notifications
You must be signed in to change notification settings - Fork 0
/
runSkimmer.sh
executable file
·45 lines (35 loc) · 1.04 KB
/
runSkimmer.sh
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
38
39
40
41
42
43
44
45
#!/bin/bash
INPUT_DATASETS=$1
if [ -z "$INPUT_DATASETS" ]; then
echo "Usage: ./runSkimmer.sh <input_datasets>"
exit 1
fi
echo "Creating tarball of Skimming code"
if [ -d "package.tar.gz" ]; then
rm package.tar.gz
fi
if [ ! -d "nanoaod-skim" ]; then
echo nanoaod-skim directory not found!
fi
tar -czf package.tar.gz nanoaod-skim/
echo "Submitting jobs for datasets: $INPUT_DATASETS"
# if CMSSW is not set, set it
if [ -z "$CMSSW_VERSION" ]; then
echo "CMSSW environment not found!"
exit 1
fi
echo "Making list of files in datasets"
rm -f file_list.txt; touch file_list.txt
for dataset in $(echo $INPUT_DATASETS | tr "," "\n"); do
timeout 30 dasgoclient --query="file dataset=$dataset" >> file_list.txt
if [ $? -ne 0 ]; then
echo "Getting file list from DAS timed out!, retrying..."
timeout 30 dasgoclient --query="file dataset=$dataset" >> file_list.txt
fi
done
if [ $? -ne 0 ]; then
echo "!!! Error in getting file list from DAS !!!"
exit 1
fi
echo "Sumitting jobs to condor"
condor_submit submit.jdl