|
|
Ligne 5: |
Ligne 5: |
| Tool to get a dump of a DPM SE documented in : | | Tool to get a dump of a DPM SE documented in : |
| https://twiki.cern.ch/twiki/bin/view/Atlas/DDMOperationsScripts#Dump_of_SE). | | https://twiki.cern.ch/twiki/bin/view/Atlas/DDMOperationsScripts#Dump_of_SE). |
| * Procedure used by Emmanuel@LPC to generate the dump | | * [[LPC:DUMP_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
| |
--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).