zoukankan      html  css  js  c++  java
  • linux mutt发送报表

    2015-11-24

    yum -y install postfix mutt
    
    vim /etc/postfix/main.cf 
    inet_protocols = ipv4
    mydomain = pateo.com.cn
    service postfix restart
    
    vim /etc/mail.rc
    set smtp=127.0.0.1
    set from=root@ivi-prod-sdb-srv1
    
    vim /etc/Muttrc
    set from=root@ivi-prod-sdb-srv1
    set sendmail="/usr/sbin/sendmail.postfix"
    set use_from=yes
    set realname="系统"
    set editor="vim"
    
    cd /data/home/cenliang/shell/ && vim mail_body.txt
    Dear all,
    
            Attached is ipda_active report.
    
    Best Regards!
    
    cd /data/home/cenliang/shell/ && vim ipda_active.sh
    #!/bin/bash
    mysql -uroot -ppro#pateo -e "select  distinct(c.vin)  as '虚拟vin', upper(v.vhl_vin) as '真实vin', v.pdsn , c.create_time as '激活时间' ,  a.sw_reference as '软件版本号', u.login_name as '激活手机号'   from  tas.contract c , bdc.atb_profile a, tas.vhl_profile v   left join  tas.vhl_user u   on  v.customer_id = u.id   where  c.contract_status = '3' and c.record_status='1'  and c.vin = v.vin  and v.vhl_brand_id = '1'  and c.vin = a.vin;" >ipda_active0.xls 
    
    iconv -futf8 -tgb2312 -oipda_active.xls ipda_active0.xls

    sleep 5m
    mutt chunminghu@pateo.com.cn
    -c leocen@pateo.com.cn -s "`date +%Y-%m-%d` ipda_active" -a /data/home/cenliang/shell/ipda_active.xls < /data/home/cenliang/shell/mail_body.txt
  • 相关阅读:
    Redis集群搭建步骤
    JS性能优化
    javaweb中实现在线人数统计
    tomcat在linux中启动慢的解决方案
    Redis高可用架构
    bjpowernode课程体系及题库
    java 相关
    码农翻身全年文章精华
    Spring源码深度解析
    PHPSTROM快捷键备份
  • 原文地址:https://www.cnblogs.com/cenliang/p/4992400.html
Copyright © 2011-2022 走看看