def installdefaultESSProc(): # default ESSProc workers_dir = os.environ['WORKERS_DIR'] log_dir = os.environ['LOG_DIR'] ESSProc_list=(('1','SIPReceiver','%s/SIPReceiver.pyc' % workers_dir,'%s/SIPReceiver.log' % log_dir,1,30,0,0,0,0), ('3','SIPValidateAIS','%s/SIPValidateAIS.pyc' % workers_dir,'%s/SIPValidateAIS.log' % log_dir,1,5,0,0,0,0), ('4','SIPValidateApproval','%s/SIPValidateApproval.pyc' % workers_dir,'%s/SIPValidateApproval.log' % log_dir,1,5,0,0,0,0), ('5','SIPValidateFormat','%s/SIPValidateFormat.pyc' % workers_dir,'%s/SIPValidateFormat.log' % log_dir,1,5,0,0,0,0), ('6','AIPCreator','%s/AIPCreator.pyc' % workers_dir,'%s/AIPCreator.log' % log_dir,1,5,0,0,0,0), ('7','AIPChecksum','%s/AIPChecksum.pyc' % workers_dir,'%s/AIPChecksum.log' % log_dir,1,5,0,0,0,0), ('8','AIPValidate','%s/AIPValidate.pyc' % workers_dir,'%s/AIPValidate.log' % log_dir,1,5,0,0,0,0), ('9','SIPRemove','%s/SIPRemove.pyc' % workers_dir,'%s/SIPRemove.log' % log_dir,1,5,0,0,0,0), ('10','AIPWriter','%s/AIPWriter.pyc' % workers_dir,'%s/AIPWriter.log' % log_dir,1,15,0,0,0,0), ('11','AIPPurge','%s/AIPPurge.pyc' % workers_dir,'%s/AIPPurge.log' % log_dir,1,5,0,0,0,0), ('12','TLD','%s/TLD.pyc' % workers_dir,'%s/TLD.log' % log_dir,2,5,0,0,0,0), ('13','IOEngine','%s/IOEngine.pyc' % workers_dir,'%s/IOEngine.log' % log_dir,8,5,0,0,0,0), ('14','db_sync_ais','%s/db_sync_ais.pyc' % workers_dir,'%s/db_sync_ais.log' % log_dir,1,10,0,0,0,0), ('16','ESSlogging','%s/ESSlogging.pyc' % workers_dir,'%s/ESSlogging.log' % log_dir,2,5,0,0,0,0), ('17','AccessEngine','%s/AccessEngine.pyc' % workers_dir,'%s/AccessEngine.log' % log_dir,3,5,0,0,0,0), ('18','FTPServer','%s/FTPServer.pyc' % workers_dir,'%s/FTPServer.log' % log_dir,2,5,0,0,0,0), ) for row in ESSProc_list: if not ESSProc.objects.filter(Name=row[1]).exists(): print "Adding entry to ESSProc for %s" % str(row[1]) ESSProc_obj = ESSProc() ESSProc_obj.id=row[0] ESSProc_obj.Name=row[1] ESSProc_obj.Path=row[2] ESSProc_obj.LogFile=row[3] ESSProc_obj.expected_pids=row[4] ESSProc_obj.Time=row[5] ESSProc_obj.Status=row[6] ESSProc_obj.Run=row[7] ESSProc_obj.PID=row[8] ESSProc_obj.Pause=row[9] ESSProc_obj.save()
def installdefaultESSProc(): # default ESSProc workers_path = '/ESSArch/pd/python/lib/python2.7/site-packages/ESSArch_EPP/workers' ESSProc_list=(('1','SIPReceiver',os.path.join(workers_path, 'SIPReceiver.pyc'),'/ESSArch/log/SIPReceiver.log',1,30,0,0,0,0), ('3','SIPValidateAIS',os.path.join(workers_path, 'SIPValidateAIS.pyc'),'/ESSArch/log/SIPValidateAIS.log',1,5,0,0,0,0), ('4','SIPValidateApproval',os.path.join(workers_path, 'SIPValidateApproval.pyc'),'/ESSArch/log/SIPValidateApproval.log',1,5,0,0,0,0), ('5','SIPValidateFormat',os.path.join(workers_path, 'SIPValidateFormat.pyc'),'/ESSArch/log/SIPValidateFormat.log',1,5,0,0,0,0), ('6','AIPCreator',os.path.join(workers_path, 'AIPCreator.pyc'),'/ESSArch/log/AIPCreator.log',1,5,0,0,0,0), ('7','AIPChecksum',os.path.join(workers_path, 'AIPChecksum.pyc'),'/ESSArch/log/AIPChecksum.log',1,5,0,0,0,0), ('8','AIPValidate',os.path.join(workers_path, 'AIPValidate.pyc'),'/ESSArch/log/AIPValidate.log',1,5,0,0,0,0), ('9','SIPRemove',os.path.join(workers_path, 'SIPRemove.pyc'),'/ESSArch/log/SIPRemove.log',1,5,0,0,0,0), ('10','AIPWriter',os.path.join(workers_path, 'AIPWriter.pyc'),'/ESSArch/log/AIPWriter.log',1,15,0,0,0,0), ('11','AIPPurge',os.path.join(workers_path, 'AIPPurge.pyc'),'/ESSArch/log/AIPPurge.log',1,5,0,0,0,0), ('12','TLD',os.path.join(workers_path, 'TLD.pyc'),'/ESSArch/log/TLD.log',2,5,0,0,0,0), #('13','IOEngine',os.path.join(workers_path, 'IOEngine.pyc'),'/ESSArch/log/IOEngine.log',8,5,0,0,0,0), ('14','db_sync_ais',os.path.join(workers_path, 'db_sync_ais.pyc'),'/ESSArch/log/db_sync_ais.log',1,10,0,0,0,0), ('16','ESSlogging',os.path.join(workers_path, 'ESSlogging.pyc'),'/ESSArch/log/ESSlogging.log',2,5,0,0,0,0), ('17','AccessEngine',os.path.join(workers_path, 'AccessEngine.pyc'),'/ESSArch/log/AccessEngine.log',3,5,0,0,0,0), ('18','FTPServer',os.path.join(workers_path, 'FTPServer.pyc'),'/ESSArch/log/FTPServer.log',2,5,0,0,0,0), ) for row in ESSProc_list: if not ESSProc.objects.filter(Name=row[1]).exists(): print "Adding entry to ESSProc for %s" % str(row[1]) ESSProc_obj = ESSProc() ESSProc_obj.id=row[0] ESSProc_obj.Name=row[1] ESSProc_obj.Path=row[2] ESSProc_obj.LogFile=row[3] ESSProc_obj.expected_pids=row[4] ESSProc_obj.Time=row[5] ESSProc_obj.Status=row[6] ESSProc_obj.Run=row[7] ESSProc_obj.PID=row[8] ESSProc_obj.Pause=row[9] ESSProc_obj.save()
def installdefaultESSProc(): # default ESSProc ESSProc_list=(('1','SIPReceiver','/ESSArch/bin/SIPReceiver.pyc','/ESSArch/log/SIPReceiver.log',30,0,0,0,0), ('3','SIPValidateAIS','/ESSArch/bin/SIPValidateAIS.pyc','/ESSArch/log/SIPValidateAIS.log',5,0,0,0,0), ('4','SIPValidateApproval','/ESSArch/bin/SIPValidateApproval.pyc','/ESSArch/log/SIPValidateApproval.log',5,0,0,0,0), ('5','SIPValidateFormat','/ESSArch/bin/SIPValidateFormat.pyc','/ESSArch/log/SIPValidateFormat.log',5,0,0,0,0), ('6','AIPCreator','/ESSArch/bin/AIPCreator.pyc','/ESSArch/log/AIPCreator.log',5,0,0,0,0), ('7','AIPChecksum','/ESSArch/bin/AIPChecksum.pyc','/ESSArch/log/AIPChecksum.log',5,0,0,0,0), ('8','AIPValidate','/ESSArch/bin/AIPValidate.pyc','/ESSArch/log/AIPValidate.log',5,0,0,0,0), ('9','SIPRemove','/ESSArch/bin/SIPRemove.pyc','/ESSArch/log/SIPRemove.log',5,0,0,0,0), ('10','AIPWriter','/ESSArch/bin/AIPWriter.pyc','/ESSArch/log/AIPWriter.log',15,0,0,0,0), ('11','AIPPurge','/ESSArch/bin/AIPPurge.pyc','/ESSArch/log/AIPPurge.log',5,0,0,0,0), ('12','TLD','/ESSArch/bin/TLD.pyc','/ESSArch/log/TLD.log',5,0,0,0,0), ('13','IOEngine','/ESSArch/bin/IOEngine.pyc','/ESSArch/log/IOEngine.log',5,0,0,0,0), ('14','db_sync_ais','/ESSArch/bin/db_sync_ais.pyc','/ESSArch/log/db_sync_ais.log',10,0,0,0,0), ('16','ESSlogging','/ESSArch/bin/ESSlogging.pyc','/ESSArch/log/ESSlogging.log',5,0,0,0,0), ('17','AccessEngine','/ESSArch/bin/AccessEngine.pyc','/ESSArch/log/AccessEngine.log',5,0,0,0,0), ('18','FTPServer','/ESSArch/bin/FTPServer.pyc','/ESSArch/log/FTPServer.log',5,0,0,0,0), ) for row in ESSProc_list: if not ESSProc.objects.filter(Name=row[1]).exists(): print "Adding entry to ESSProc for %s" % str(row[1]) ESSProc_obj = ESSProc() ESSProc_obj.id=row[0] ESSProc_obj.Name=row[1] ESSProc_obj.Path=row[2] ESSProc_obj.LogFile=row[3] ESSProc_obj.Time=row[4] ESSProc_obj.Status=row[5] ESSProc_obj.Run=row[6] ESSProc_obj.PID=row[7] ESSProc_obj.Pause=row[8] ESSProc_obj.save()