1 |
ratnik |
1.1 |
#!/bin/bash
|
2 |
|
|
|
3 |
|
|
# Requires that postrgres-python is installed
|
4 |
|
|
# Requires the "chimera-dump.py" script available
|
5 |
|
|
# Requires cd_conf.py to contain the name of the Chimera host (dchpnfs)
|
6 |
|
|
# Requires the Chimera host to accept Postgres queries from this host
|
7 |
|
|
|
8 |
|
|
# Run the chimera dump
|
9 |
|
|
./chimera-dump.py -s /pnfs/ciemat.es/data/cms/ -c fulldump -o dcache.cms.dump
|
10 |
|
|
|
11 |
|
|
# Uncompress it (required for sed operation)
|
12 |
|
|
bunzip2 dcache.cms.dump.xml.bz2
|
13 |
|
|
|
14 |
|
|
# Transform it (PFN -> LFN)
|
15 |
|
|
sed -e 's#/pnfs/ciemat.es/data/cms/store/user/#/store/user/#' \
|
16 |
|
|
-e 's#/pnfs/ciemat.es/data/cms/scratch/user/#/store/temp/user/#' \
|
17 |
|
|
-e 's#/pnfs/ciemat.es/data/cms/store/group/#/store/group/#' \
|
18 |
|
|
-e 's#/pnfs/ciemat.es/data/cms/prod/store/#/store/#' \
|
19 |
|
|
-e '/\/pnfs\/ciemat.es\/data\/cms\/Tier3/d' \
|
20 |
|
|
-e '/\/pnfs\/ciemat.es\/data\/cms\/generated/d' \
|
21 |
|
|
-e 's#<dCache:location>.*<dCache:location>##' \
|
22 |
|
|
dcache.cms.dump.xml | uniq > dcache.cms.dump.xml.new
|
23 |
|
|
|
24 |
|
|
mv dcache.cms.dump.xml.new dcache.cms.dump.xml
|
25 |
|
|
|
26 |
|
|
# Compress it again
|
27 |
|
|
bzip2 dcache.cms.dump.xml
|