Difference between revisions of "Atlas:Instructions to sites"
(→Operational Instructions and Recipies to ATLAS sites) |
|||
Ligne 1: | Ligne 1: | ||
--[[User:Chollet|Chollet]] 15:37, 11 mars 2009 (CET) | --[[User:Chollet|Chollet]] 15:37, 11 mars 2009 (CET) | ||
== Operational Instructions and Recipies to ATLAS sites == | == Operational Instructions and Recipies to ATLAS sites == | ||
+ | |||
+ | * Get dumps of ATLAS SE to remove dark data | ||
+ | Tool to get a dump of a DPM SE documented in : | ||
+ | https://twiki.cern.ch/twiki/bin/view/Atlas/DDMOperationsScripts#Dump_of_SE). | ||
+ | * Procedure used by Emmanuel@LPC to generate the dump | ||
+ | The script given on that page is not completely correct, names may be | ||
+ | partially/wrongly generated as it depends on the scan order. | ||
+ | **1st step: Snapshot of the Cns_file_metadata table | ||
+ | |||
+ | /usr/bin/mysql -u root -p... -A > output << EOF | ||
+ | use cns_db; | ||
+ | select fileid, parent_fileid,name,filesize,filemode from Cns_file_metadata | ||
+ | EOF | ||
+ | |||
+ | **2nd step: Convert in XML format with full filename. | ||
+ | |||
+ | DATE=`date --iso-8601` | ||
+ | |||
+ | cat > atlas.syncat.xml << EOF | ||
+ | <?xml version="1.0" encoding="iso-8859-1" ?> | ||
+ | <dump recorded=" ${DATE} "> | ||
+ | <for>vo:atlas</for> | ||
+ | <entry-set> | ||
+ | EOF | ||
+ | |||
+ | awk ' | ||
+ | BEGIN { Cache[0]=""; } | ||
+ | |||
+ | function FullName(id) | ||
+ | { | ||
+ | if (!(id in Cache)) { | ||
+ | if (Parent[id] == 0) | ||
+ | Cache[id]= IDName[id]; | ||
+ | else | ||
+ | Cache[id]= FullName(Parent[id]) "/" IDName[id]; | ||
+ | } | ||
+ | return Cache[id]; } | ||
+ | |||
+ | /^[0-9]/ { FILEID=$1; PARENTID=$2; NAME=$3; SIZE=$4; FILEMODE=$5; | ||
+ | Parent[FILEID]=PARENTID; | ||
+ | IDName[FILEID]=NAME; | ||
+ | Taille[FILEID]=SIZE; | ||
+ | Mode[FILEID]=FILEMODE; | ||
+ | } | ||
+ | END { for (id in Mode) | ||
+ | if (Mode[id] > 30000) | ||
+ | print FullName(id), Taille[id]; | ||
+ | }' output > output2 | ||
+ | |||
+ | # Generate files under /dpm/in2p3.fr/home/atlas | ||
+ | awk '// { print "<entry name=\"" substr($1, 2) "\"> <size>\"" $2 | ||
+ | "\"</size> <checksum></checksum> </entry>"; }' output2 | grep | ||
+ | "/dpm/in2p3.fr/home/atlas" >> atlas.syncat.xml | ||
+ | |||
+ | cat >> atlas.syncat.xml << EOF | ||
+ | </entry-set></dump> | ||
+ | EOF |
Version du 11:27, 18 février 2010
--Chollet 15:37, 11 mars 2009 (CET)
Operational Instructions and Recipies to ATLAS sites
- Get dumps of ATLAS SE to remove dark data
Tool to get a dump of a DPM SE documented in : https://twiki.cern.ch/twiki/bin/view/Atlas/DDMOperationsScripts#Dump_of_SE).
- Procedure used by Emmanuel@LPC to generate the dump
The script given on that page is not completely correct, names may be partially/wrongly generated as it depends on the scan order.
- 1st step: Snapshot of the Cns_file_metadata table
/usr/bin/mysql -u root -p... -A > output << EOF use cns_db; select fileid, parent_fileid,name,filesize,filemode from Cns_file_metadata EOF
- 2nd step: Convert in XML format with full filename.
DATE=`date --iso-8601`
cat > atlas.syncat.xml << EOF <?xml version="1.0" encoding="iso-8859-1" ?> <dump recorded=" ${DATE} "> <for>vo:atlas</for> <entry-set> EOF
awk ' BEGIN { Cache[0]=""; } function FullName(id) { if (!(id in Cache)) { if (Parent[id] == 0) Cache[id]= IDName[id]; else Cache[id]= FullName(Parent[id]) "/" IDName[id]; } return Cache[id]; }
/^[0-9]/ { FILEID=$1; PARENTID=$2; NAME=$3; SIZE=$4; FILEMODE=$5; Parent[FILEID]=PARENTID; IDName[FILEID]=NAME; Taille[FILEID]=SIZE; Mode[FILEID]=FILEMODE; } END { for (id in Mode) if (Mode[id] > 30000) print FullName(id), Taille[id]; }' output > output2
# Generate files under /dpm/in2p3.fr/home/atlas awk '// { print "<entry name=\"" substr($1, 2) "\"> <size>\"" $2 "\"</size> <checksum></checksum> </entry>"; }' output2 | grep "/dpm/in2p3.fr/home/atlas" >> atlas.syncat.xml
cat >> atlas.syncat.xml << EOF </entry-set></dump> EOF