Skip to content

Instantly share code, notes, and snippets.

@mmusich mmusich/countTBs.py
Created Oct 30, 2018

Embed
What would you like to do?
import os,sys
import getopt
import commands
import time
import ROOT
import urllib
import string
from optparse import OptionParser
totalsize=0
datasets = commands.getstatusoutput("dasgoclient -query='dataset dataset=/*/*2017*TkAl*Nov*/ALCARECO'")[1].split("\n")
print datasets
for pd in datasets:
print pd,","
toAdd=commands.getstatusoutput("dasgoclient -query='summary dataset="+pd+" | grep summary.file_size'")[1]
if len(toAdd)>0:
totalsize+=float(toAdd)
#print "toAdd:",toAdd
print "======================="
print totalsize/(1000*1000*1000*1000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.