#!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)
 

Logo

CSDN联合极客时间,共同打造面向开发者的精品内容学习社区,助力成长!

更多推荐