超级强悍的mysql自动备份脚本
八月 8th, 2010 Posted in mysql | 阅读次数: 690 次
Author:gaojinbo
Time:2010-8-8
经过数月的使用,觉得非常好,是备份mysql数据库的利器,特与大家分享!
这个工具使用gpl协议,项目地址:http://sourceforge.net/projects/automysqlbackup/
一、如何使用
1.下载最新的备份脚本
2.修改脚本配置部分
vi /root/automysqlbackup-2.5.1-01.sh
USERNAME=root
PASSWORD=gaojinbo
BACKUPDIR="/www/backup/db"
MAILADDR="admin@gaojinbo.com"
3.设置每天晚上3点半自动备份mysql
crontab -e
30 03 * * * /root/automysqlbackup-2.5.1-01.sh
4.增加执行权限
chmod +x /root/automysqlbackup-2.5.1-01.sh
5.安装postfix,备份日志会自动发送到上面指定的邮箱
yum install potfix
完成!
相关日志:
Tags: mysql
八月 10th, 2010 at 00:50
正在下载中,很期待这种功能,本地通过网络备份上传到邮箱???
马上试下先,文件才19M。
八月 10th, 2010 at 00:51
有没有中文版的教程,或者相关介绍。
八月 10th, 2010 at 02:17
唉啊,很不明白啊。可能是点广告,下载了一个GNU。。。用什么去运行这个automysqlbackup-2.5.1-01.sh
能在XP里使用这个功能吗?需要什么软件的支持,烦请指教。
八月 10th, 2010 at 08:51
本地通过网络备份上传到邮箱?不会上传sql备份数据到邮箱,只会发送备份日志到邮箱,可以自己写脚本实现这个功能。
xp不能使用这个sh备份脚本!
八月 27th, 2010 at 21:59
默认安装了sendmail,没安装 postfix,可以发邮件吗?
Available Packages
Name : postfix
Arch : i386
Epoch : 2
Version : 2.3.3
Release : 2.1.el5_2
Size : 3.6 M
Repo : base
Summary : Postfix Mail Transport Agent
URL : http://www.postfix.org
License : IBM Public License
Description: Postfix is a Mail Transport Agent (MTA), supporting LDAP, SMTP AUTH (SASL),
: TLS
Name : sendmail
Arch : i386
Version : 8.13.8
Release : 8.el5
Size : 1.3 M
Repo : installed
Summary : A widely used Mail Transport Agent (MTA).
License : Sendmail
Description: The Sendmail program is a very widely used Mail Transport Agent (MTA).
: MTAs send mail from one machine to another. Sendmail is not a client
: program, which you use to read your email. Sendmail is a
: behind-the-scenes program which actually moves your email over
: networks or the Internet to where you want it to go.
:
: If you ever need to reconfigure Sendmail, you will also need to have
: the sendmail.cf package installed. If you need documentation on
: Sendmail, you can install the sendmail-doc package.
八月 27th, 2010 at 22:02
我正在使用的脚本是这个,自己实现,分享一下
#!/bin/sh
# Script name : auto_mysql_dump.sh
# Backup the dbname database
root=”/backups”
dir=`date +%Y-%m-%d`
dbname=”test”
if [ -d $root ]; then
mkdir -p $root/$dir
mysqldump -B –user=root –password=123456 –host=127.0.0.1 $dbname > $root/$dir/$dbname.sql
if [ $?=0 ]; then
#Bzip2 the dump.sql
#bzip2 -z9v $root/$dir/$dbname.sql
cd $root/$dir
tar zcvf $dbname.tar.gz $dbname.sql
#Remove the dump.sql from disk
rm -f $root/$dir/$dbname.sql
fi
fi
# End of script auto_mysql_dump.sh
~
八月 29th, 2010 at 10:20
默认安装了sendmail,没安装 postfix,可以发邮件!
八月 29th, 2010 at 10:21
建议大家使用xtrabackup来备份mysql数据,这个工具更好用。
http://www.gaojinbo.com/mysql-dba%E9%A6%96%E9%80%89%E5%A4%87%E4%BB%BD%E5%B7%A5%E5%85%B7xtrabackup%E5%AE%89%E8%A3%85%E9%85%8D%E7%BD%AEv1-1.html
十一月 18th, 2010 at 16:33
最后一步为了发邮件而装postfix有点大动干戈
卖瓜一下:console下通过smtp发送邮件的工具——SendmailViaSMTP
http://www.himysql.com/python/sending-mail-through-smtp-server-under-console.html
仅仅一个.py文件,跨平台,跨架构,支持gmail,可以直接从命令行运行,也可以在shell里调用
写这个工具的初衷就是为了解决很多服务器发送报警、报告等邮件的问题
一月 11th, 2011 at 21:50
…
[...]We Like to Honor it by Linking to it from Our Blog. Here is a Quality Page You Might Find Interesting that we Encourage You to Check[...]…
六月 15th, 2011 at 10:47
public smtp server relay…
超级强悍的mysql自动备份脚本 | 高进波博客 – 零起点一步配置你的linux服务器,linux博客,linux教程,web架构…
十一月 6th, 2011 at 05:58
Microsoft Office Enterprise…
[...]高进波博客 – 零起点一步配置你的linux服务器,linux博客,linux教程,web架构 » Blog Archive » 超级强悍的mysql自动备份脚本[...]…