5Get list of runs taken in last xx seconds
9__usage__ =
'''%prog [options]
11Get list of runs taken in last xx seconds
13from DQUtils.oracle
import fetch_recent_runs
16from optparse
import OptionParser
17parser = OptionParser(usage=__usage__, version=__version__)
18parser.add_option(
'',
'--outputDir', dest=
'outputDir', default=
'/afs/cern.ch/user/a/atlidbs/nt/DataPeriods/data_latest', help=
'Output directory for file with run list')
19(options,args) = parser.parse_args()
23 parser.error(
'wrong number of command line arguments')
27filename = options.outputDir+
'/'+fileLabel+
'.runs.list'
30if path.exists(filename):
31 os.system(
'rm ' + filename)
33with open(filename,
'w')
as f:
34 f.write(
'\n'.join([str(r[1])
for r
in fetch_recent_runs(int(interval))]))