【ogg】oggexec.py(批处理方式linux调用)
#!C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\python# -*- coding:utf-8 -*-import osimport timefrom mail.mail import *def ogg(cmd):receiver = 'li_tao@neusoft.com'...
#!C:\Users\Administrator\AppData\Local\Programs\Python\Python37-32\python
# -*- coding:utf-8 -*-
import os
import time
from mail.mail import *
def ogg(cmd):
receiver = 'li_tao@neusoft.com'
sub='ogg:'
cont='hello taoge'
sub1="兰州市生产库ogg监控报告:"+time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
cont=os.popen("D:\oggjiankong\lzgg.bat").read()
print(sub)
print(cont)
cont1="兰州市生产库ogg监控报告:\n\n"+cont[cont.find("Program"):cont.find("GGSCI (pc) 2")]+"\n以上报告请相关负责人关注!\n谢谢"
#sendmail(receiver,sub,cont)
sub2="兰州市灾备库ogg监控报告:"+time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
cont=os.popen("D:\oggjiankong\lzgg60.bat").read()
print(sub)
print(cont)
cont2="兰州市灾备库ogg监控报告:\n\n"+cont[cont.find("Program"):cont.find("GGSCI (pc) 2")]+"\n以上报告请相关负责人关注!\n谢谢"
sub="兰州市ogg监控报告:"+time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
cont=sub1+"\n"+cont1+"\n\n"+sub2+"\n"+cont2
print("================================\n")
print(cont)
sendmail(receiver,sub,cont)
更多推荐
所有评论(0)