#!/bin/bash rm -f /tmp/myPoolFileCatalog.xml newPoolFileCatalog.xml DCACHESETUP=/local/workdir/d-cache.setup.sh ATLAS_APP=/share/app/atlas_app DSS_ATLAS_REL="12.0.3" DSS_STORE=/share/data/t2data #Make a backup copy workdir=`pwd` cd ${DSS_STORE} cp PoolFileCatalog.xml old_PoolFileCatalog.xml chgrp atlas old_PoolFileCatalog.xml chmod 666 old_PoolFileCatalog.xml cd $workdir #setup the ATLAS environment. d-cache MUST be set up first source ${DCACHESETUP} source ${ATLAS_APP}/atlas_rel/${DSS_ATLAS_REL}/cmtsite/setup.sh -tag=AtlasOffline,${DSS_ATLAS_REL} source ${ATLAS_APP}/atlas_rel/${DSS_ATLAS_REL}/AtlasOffline/${DSS_ATLAS_REL}/AtlasOfflineRunTime/cmt/setup.sh #Create a myPoolFileCatalog.xml file containing all pfns thbat have the string "root" in them FCpublish -d file:/tmp/myPoolFileCatalog.xml -u mysqlcatalog_mysql://dq2user:dqpwd@tier2-05.uchicago.edu/localreplicas -q "pfname like '%.root.%'" #Edit the myPoolFileCatalog.xml file substituting gsiftp with dcache and filetype of NULL with ROOT_ALL cat /tmp/myPoolFileCatalog.xml|sed -e 's/gsiftp:\/\/tier2-d1.uchicago.edu:2811/dcache:/;s/filetype=\"NULL\"/filetype=\"ROOT_All\"/' > newPoolFileCatalog.xml if [ -s newPoolFileCatalog.xml ] then mv newPoolFileCatalog.xml ${DSS_STORE}/PoolFileCatalog.xml chmod 666 ${DSS_STORE}/PoolFileCatalog.xml chgrp atlas ${DSS_STORE}/PoolFileCatalog.xml exit 0 else #error condition occurred - do not overwrite the existing PoolFileCatalog.xml file exit 1 fi rm -f /tmp/myPoolFileCatalog.xml