User Tools

Site Tools


restart_process_and_send_mail_if_fail

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
restart_process_and_send_mail_if_fail [2012/04/10 14:29]
k2patel
restart_process_and_send_mail_if_fail [2012/04/10 14:30] (current)
k2patel
Line 24: Line 24:
 def message(msg):​ def message(msg):​
     server = smtplib.SMTP('​localhost'​)     server = smtplib.SMTP('​localhost'​)
-    subject = "​Subject:​ [V6 CRON] Error : failed to execute"​+    subject = "​Subject:​ [CRON] Error : failed to execute ​Process"
     msg = subject + '​\n'​ + msg     msg = subject + '​\n'​ + msg
     print msg     print msg
Line 41: Line 41:
  
 try: try:
-    subprocess.check_call(['​su',​ '​-',​ 'mcfapps', '​-c',​ '​live/​interchange/​bin/​interchange'​])+    subprocess.check_call(['​su',​ '​-',​ 'kpatel', '​-c',​ '​live/​interchange/​bin/​interchange'​])
 except subprocess.CalledProcessError as prit: except subprocess.CalledProcessError as prit:
     message(str(prit))     message(str(prit))
 </​code>​ </​code>​
restart_process_and_send_mail_if_fail.txt ยท Last modified: 2012/04/10 14:30 by k2patel