CMS 3D CMS Logo

dqmPostProcessing_online.py

Go to the documentation of this file.
00001 #! /usr/bin/env python
00002 
00003 import os,time,sys,shutil
00004 
00005 #DIR = '/cms/mon/data/dropbox'  # directory to search new files
00006 #TimeTag = '/cms/mon/data/dropbox/timetag' #file for time tag for searching new file
00007 
00008 #### Directories and files for test and development
00009 DIR = '/cms/mon/data/dropbox_test'  # directory to search new files
00010 TimeTag = '/cms/mon/data/dropbox_test/timetag' #file for time tag for searching new file
00011 
00012 WAITTIME = 120 # waiting time for new files (sec)
00013 MERGE_EXE = '/cms/mon/data/dqm/filereg_test/mergeAndRegister.py'
00014 
00015 if not os.path.exists(TimeTag):
00016         os.system('touch -t 01010000 '+ TimeTag)
00017 
00018 
00019 ####### ENDLESS LOOP WITH SLEEP
00020 while 1:
00021 
00022     #### trigger by new files
00023     NEW_ = os.popen('find '+ DIR +'/ -type f -name "DQM_*_R?????????.root" -newer '+ TimeTag).read().split()
00024     if len(NEW_)==0:
00025         print 'waiting for new files...'
00026         time.sleep(WAITTIME)
00027         continue
00028 
00029     #### start 'merge & register'
00030     execfile(MERGE_EXE)
00031     print '**** merged files ****'
00032     for filename in mergedfiles:
00033             print filename
00034             NEW_ = os.popen('GetAndWriteDQMSummeryIntoOMDS ' +  filename + ' GetAndWriteOMDSSummeryIntoOMDS.log').read()
00035             print NEW_

Generated on Tue Jun 9 17:33:09 2009 for CMSSW by  doxygen 1.5.4