00001
00002
00003 import os,time,sys,shutil
00004
00005
00006
00007
00008
00009 DIR = '/cms/mon/data/dropbox_test'
00010 TimeTag = '/cms/mon/data/dropbox_test/timetag'
00011
00012 WAITTIME = 120
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
00020 while 1:
00021
00022
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
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_