forked from cernopendata/data-curation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmake_local_cache.sh
executable file
·64 lines (53 loc) · 2.31 KB
/
make_local_cache.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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#!/bin/bash
# Usage:
# $ YYYY=2010 ./make_local_cache.sh
# this script makes a local cache of a list of CMS MC datasets
if [ -z ${YYYY} ]; then
echo "[ERROR] Please set YYYY environment variable with wanted year."
echo "[ERROR] Example: YYYY=2010 $0"
exit 1
fi
year=${YYYY}
datasets="inputs/CMS-"$year"-mc-datasets.txt"
# TODO
# targz each step
# mount the dirs in RAM to avoid file number limit
# step 1
export EOS_MGM_URL=root://eospublic.cern.ch
python code/interface.py --create-eos-indexes \
--eos-dir ./cache/$year/eos-file-indexes/ \
$datasets 2>eos-indexes-${year}.err || exit $?
# step 2
# you should have voms-proxy here!
# voms-proxy-init --voms cms --rfc --valid 190:00
python code/interface.py --create-das-json-store \
--ignore-eos-store \
--eos-dir ./cache/$year/eos-file-indexes/ \
--das-dir ./cache/$year/das-json-store/ \
$datasets 2>das-store-${year}.err || exit $?
# step 3
python code/interface.py --create-mcm-store \
--ignore-eos-store \
--eos-dir ./cache/$year/eos-file-indexes/ \
--das-dir ./cache/$year/das-json-store/ \
--mcm-dir ./cache/$year/mcm-store/ \
$datasets 2>mcm-store-${year}.err || exit $?
# step 4
# in ~/.globus/ dir, follow the instructions from
# https://ca.cern.ch/ca/help/?kbid=024010 and also this other command:
# $ openssl pkcs12 -in myCert.p12 -nocerts -nodes -out userkey.nodes.pem
python code/interface.py --get-conf-files \
--ignore-eos-store \
--eos-dir ./cache/$year/eos-file-indexes/ \
--das-dir ./cache/$year/das-json-store/ \
--mcm-dir ./cache/$year/mcm-store/ \
--conf-dir ./cache/$year/config-store/ \
$datasets 2>conffiles-${year}.err || exit $?
echo -e "\n\n"
echo -e ":)"
echo -e "Local cache created in ./cache/${year}/"
echo -e "Check the error files in current dir:"
echo -e "\t - eos-indexes-${year}.err"
echo -e "\t - das-store-${year}.err"
echo -e "\t - mcm-store-${year}.err"
echo -e "\t - conffiles-${year}.err"