DBS Client
Users can query DBS interactively from a shell command-promt using the GO client: dasgoclient
The client is available in
/cvmfs/cms.cern.ch/common/
and can be used after obtaining a VOMS proxy:
voms-proxy-init -voms cms -valid 168:00 -rfc
/cvmfs/cms.cern.ch/common/dasgoclient
It provides an extensive set of examples of various types of searches when executed with the '-examples
' argument:
/cvmfs/cms.cern.ch/common/dasgoclient -examples
### BLOCK QUERIES:
# find blocks for a given dataset/block/file
block dataset=/ElectronHad/Run2011A-05Aug2011-v1/AOD
block=/EG/Run2010A-Dec4ReReco_v1/AOD#f15ed71e-6491-4f73-a0e3-ac4248a6367d
block file=/store/data/Run2010B/ZeroBias/RAW-RECO/v2/000/145/820/784478E3-52C2-DF11-A0CC-0018F3D0969A.root
...
Here are some examples of frequently used searches:
#find 2010 Egamma AOD
dasgoclient -query="dataset=/EG/Run2010A*/AOD"
#find list of all files for a given dataset
dasgoclient -query="file dataset=/EG/Run2010A-Apr21ReReco-v1/AOD" --limit=0
#find datasets containing events from run number 108741
dasgoclient -query="dataset run=108741 | grep dataset.name" --limit=0
The syntax of the '-query="..."
' statement is generally the same as that used in the web-browser version of the client (DAS), but the ability to parse the output through various shell-command filters provides much more flexibility.
Here are some more complex examples:
#find for a given dataset the files of a given Run:Lumi
dasgoclient -query="file dataset=/HT/Run2011B-v1/RAW run=176304 lumi=80"
#find lumi for a given file
dasgoclient -query="lumi file=/store/data/Run2011B/MuOnia/AOD/PromptReco-v1/000/180/251/2A93D4C7-D704-E111-8E13-001D09F29619.root"
#find latest 10 files from Express Reco
dasgoclient -query="file dataset=/MuOnia/Run2011B-PromptReco-v1/AOD | grep file.name, file.creation_time | sort `echo file.creation_time | awk -F ',' '{print $1}' | sed -e 's/\[u//'`" --limit=0 | tail -n 10
Please, note in the last example where exactly the DAS query ends (the double quotes) and where the shell pipe begins (the last "|") -- this is important for successfuly using the full potential of dasgoclient integrating it with UNIX shell commands.