ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
InnerDetector
InDetExample
InDetBeamSpotExample
bin
getLatestRuns.py
Go to the documentation of this file.
1
#!/usr/bin/env python
2
3
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
4
"""
5
Get list of runs taken in last xx seconds
6
"""
7
8
__version__ =
''
9
__usage__ =
'''%prog [options]
10
11
Get list of runs taken in last xx seconds
12
'''
13
from
DQUtils.oracle
import
fetch_recent_runs
14
import
os
15
16
from
optparse
import
OptionParser
17
parser = OptionParser(usage=__usage__, version=__version__)
18
parser.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()
20
21
22
if
(len(args)) < 2:
23
parser.error(
'wrong number of command line arguments'
)
24
interval = args[0]
25
fileLabel = args[1]
26
27
filename = options.outputDir+
'/'
+fileLabel+
'.runs.list'
28
29
path = os.path
30
if
path.exists(filename):
31
os.system(
'rm '
+ filename)
32
33
with
open(filename,
'w'
)
as
f:
34
f.write(
'\n'
.join([str(r[1])
for
r
in
fetch_recent_runs(int(interval))]))
35
if
if(pathvar)
Definition
SealSharedLib.cxx:168
Generated on
for ATLAS Offline Software by
1.17.0