• 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
  • 相关阅读:
    Lumen源码分析之 一步一步带你实现Lumen容器(一)
    php 注册器模式 工厂模式
    理解 PHP 依赖注入 和 控制反转
    composer使用git作为仓储
    monolog记录日志
    Jupyter Notebook快捷键
    图像灰度化
    一道算法题:拼数字
    [转]Vue生态系统中的库
    window.postMessage实现网页间通信
  • 原文地址:https://www.cnblogs.com/cenliang/p/4992400.html
Copyright © 2020-2023  润新知