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
  • 相关阅读:
    JAVA内部类详解
    表、栈和队列
    大型网站架构演化<二>
    eclipse中build path 中JDK与java compiler compliance level的问题(转)
    XFire构建服务端Service的两种方式
    SpringMVC简单例子
    Mybatis
    java静态代码块 类加载顺序问题。
    Tomcat6.0数据源配置
    解析xml的几种方式
  • 原文地址:https://www.cnblogs.com/cenliang/p/4992400.html
Copyright © 2011-2022 走看看