MySQL慢日志切割邮件发送脚本】的更多相关文章

#!/bin/bashtime=`date -d yesterday +"%Y-%m-%d"`slowlog='/usr/local/percona/data/slow.log'#提前创建好一个存放目录:/usr/local/percona/slow_log cut_slowlog='/usr/local/percona/slow_log'mv $slowlog $cut_slowlog/slow-$time.log/usr/local/percona/bin/mysql  -S /u…
centos 7 keepalived故障邮件通知实战(附Python邮件发送脚本) #####################     sendmail.py  begin     ##################### #!/usr/bin/python -W # -*- coding: UTF-8 -*- from email.mime.multipart import MIMEMultipart from email.mime.base import MIMEBase from em…
一:日志切割步骤 命令都在root下进行 1.创建目录 mkdir -p /etc/opt/modules/bin ## 创建文件夹 2.上传cut 3.观察目录 4.修改的cut文件 5.检测 需要保证nginx已经开启 6.效果 7.定时 二:切割程序 1.脚本 #!/bin/bash # nginx日志存储的linux路径 LOGS_PATH="/usr/local/nginx/userlogs/" # 旧日志存储的linux路径 OLD_LOGS_PATH=${LOGS_PAT…
一:日志切割步骤 命令都在root下进行 1.创建目录 mkdir -p /etc/opt/modules/bin ## 创建文件夹 2.上传cut 3.观察目录 4.修改的cut文件 5.检测 需要保证nginx已经开启 6.效果 7.定时 二:切割程序 1.脚本 #!/bin/bash # nginx日志存储的linux路径 LOGS_PATH="/usr/local/nginx/userlogs/" # 旧日志存储的linux路径 OLD_LOGS_PATH=${LOGS_PAT…
脚本 #!/usr/bin/python #-*- coding:utf-8 -*- #Python Mail for chenglee #if fileformat=dos, update fileformat=unix #code:set fileformat=unix #check:set ff ? import smtplib from email.mime.text import MIMEText from email.utils import formataddr my_sender…
部分转摘:http://blog.csdn.net/azhao_dn/article/details/9118667 1.根类别(在类别层次结构的顶部,即全局性的日志级别) 配置根Logger,其语法为: log4j.rootLogger = [ level ] , appenderName, appenderName, ... level 是日志记录的类别 appenderName就是指定日志信息输出到哪个地方.您可以同时指定多个输出目的地. 类别level 为 OFF.FATAL.ERROR…
#!/bin/env python # -*- coding: utf-8 -*- import datetime import smtplib import os,sys from email.mime.text import MIMEText from email.mime.multipart import MIMEMultipart from email.mime.base import MIMEBase from optparse import OptionParser EMAILHOM…
转自:http://phinecos.cnblogs.com/ #!/usr/bin/python #coding=utf-8 #@author:dengyike #@date:2010-09-28 #@version:1.0 #@description: auto sending email with attachment file import email import mimetypes from email.MIMEMultipart import MIMEMultipart from…
测试环境:Ubuntu 11.10 1. 安装mutt及msmtp软件 sudo apt-get install mutt sudo apt-get install msmtp 2. 编辑配置文件vi ~/.muttrc set sendmail="/usr/bin/msmtp" set use_from=yes set realname="Guobao Jiang" set from=loveaborn@163.com set envelope_from=yes…
import smtplib from email.header import Header from email.mime.text import MIMEText from_addr = 'XXX@163.com' #发送邮箱的地址 password = 'XXXXXX' #发送邮箱的客户端登陆密码,可能和网页登陆密码不同,需要单独设置 smtp_server = 'smtp.163.com' to_addr = 'XXX@foxmail.com' #接收邮箱地址 msg = MIMETex…