当前时区为 UTC + 8 小时



发表新帖 回复这个主题  [ 4 篇帖子 ] 
作者 内容
1 楼 
 文章标题 : mysql自动备份脚本(现最好的备份)
帖子发表于 : 2009-06-18 10:10 

注册: 2008-10-09 10:04
帖子: 63
送出感谢: 0 次
接收感谢: 0 次
mysql自动备份脚本
A script to take daily, weekly and monthly backups of your MySQL databases using mysqldump. Features - Backup mutiple databases - Single backup file or to a seperate file for each DB - Compress backup files - Backup remote servers - E-mail logs – More

用一个脚本使用mysqldump进行每天,每周,每月的数据库备份。备份多个或一个数据库。邮寄备份日志到管理员的邮箱


AutoMySQLBackup Script Features

• Backup mutiple MySQL databases with one script. (Now able to backup ALL databases on a server easily. no longer need to specify each database seperately)


用一个脚本备份多个mysql数据库


• Backup all databases to a single backup file or to a seperate directory and file for each database.


备份所有的数据库数据到一个单独的文件或者单独的目录下


• Automatically compress the backup files to save disk space using either gzip or bzip2 compression.


自动压缩备份文件保存到硬盘上


• Can backup remote MySQL servers to a central server.





• Runs automatically using cron or can be run manually.
• Can e-mail the backup log to any specified e-mail address instead of "root". (Great for hosted websites and databases).


使用cron自动允许备份脚本


• Can email the compressed database backup files to the specified email address.
• Can specify maximun size backup to email.
• Can be set to run PRE and POST backup commands.
• Choose which day of the week to run weekly backups.

AutoMySQLBackup Download

The AutoMySQLBackup project has now been moved to Sourceforge.net for better maintainence.

http://sourceforge.net/projects/automysqlbackup/

AutoMySQLBackup Requirements

The AutoMySQLBackup script only requires mysqldump (A standard utility provided with the mysql client) and gzip or bzip2 for compression of the backup files.

If you would like to have the log emailed to you then you will need to have permission to execute the "mail" program. If you want the compressed backup files mailed to you then Mutt must be available on the server.
Finally you will need a bash shell and the standard system tools and utilities (all these requirements should be the default on most linux system.)

What AutoMySQLBackup does

Every day AutoMySQLBackup will run (if setup on /etc/cron.daily) and using mysqldump and gzip will dump your specified databases to the /backups/daily directory, it will rotate daily backups weekly so you should never have more than 7 backups in there..

Every Saturday AutoMySQLBackup will again backup the databases you have chosen but they will be placed into /backups/weekly, these will be rotated every 5 weeks so there should never be more than 5 backups in there..

Every 1st of the month AutoMySQLBackup will create a backup of all databases and place them into /backups/monthly. These will never be rotated so it will be up to you to do your own house keeping. I would suggest taking a copy of this offline every month or two so that if you have a hard drive failure you will be able to restore your database..

AutoMySQLBackup Installation

The install is as simple as editing a few variables in the AutoMySQLBackup file. The full setup is documented in the AutoMySQLBackup script file below the variables section..

Here is a quick minimum setup step by step..

1. Download automysqlbackup.sh and place it into your /etc/cron.daily directory or your home directory.

2. Edit (at least) the following lines :-
# Username to access the MySQL server e.g. dbuser
USERNAME=dbuser 输入你的数据库的管理员的名字

# Username to access the MySQL server e.g. password
PASSWORD=password 输入你的数据库管理员对应的密码


# List of DBNAMES for Daily/Weekly Backup e.g. "DB1 DB2 DB3"
DBNAMES="DB1 DB2 DB3"输入你要备份的数据库的名字,如果你要备份所有的数据库就输入all

# Backup directory location e.g /backups
BACKUPDIR="/backups" 根据你的情况输入数据库的备份的路径






3. Make the file executable :- chmod u+rwx

4. Create the following directory./backups 这个根据自己的情况决定是否创建


5. That's it.. Now you can run it using the command line "./automysqlbackup.sh" or if it is in /etc/cron.daily it will run each day when cron runs.


附件:
automysqlbackup.zip [8.02 KiB]
被下载 201 次
页首
 用户资料  
 
2 楼 
 文章标题 : Re: mysql自动备份脚本(现最好的备份)
帖子发表于 : 2009-06-18 10:36 

注册: 2009-04-23 8:20
帖子: 33
送出感谢: 0 次
接收感谢: 0 次
很有用 :em11


页首
 用户资料  
 
3 楼 
 文章标题 : Re: mysql自动备份脚本(现最好的备份)
帖子发表于 : 2012-08-31 16:00 

注册: 2009-08-14 15:01
帖子: 3
送出感谢: 0 次
接收感谢: 0 次
很有用,先看一下
谢谢分享


页首
 用户资料  
 
4 楼 
 文章标题 : Re: mysql自动备份脚本(现最好的备份)
帖子发表于 : 2012-08-31 16:17 

注册: 2007-01-14 16:23
帖子: 3927
送出感谢: 0 次
接收感谢: 96
这东西能增量或者差异备份不


_________________
#include <stdio.h>
void main()
{
double world;
unsigned letter;
short stay;
long memories;
printf("I miss you.\n");
}


页首
 用户资料  
 
显示帖子 :  排序  
发表新帖 回复这个主题  [ 4 篇帖子 ] 

当前时区为 UTC + 8 小时


在线用户

正在浏览此版面的用户:没有注册用户 和 2 位游客


不能 在这个版面发表主题
不能 在这个版面回复主题
不能 在这个版面编辑帖子
不能 在这个版面删除帖子
不能 在这个版面提交附件

前往 :  
本站点为公益性站点,用于推广开源自由软件,由 DiaHosting VPSBudgetVM VPS 提供服务。
我们认为:软件应可免费取得,软件工具在各种语言环境下皆可使用,且不会有任何功能上的差异;
人们应有定制和修改软件的自由,且方式不受限制,只要他们自认为合适。

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
简体中文语系由 王笑宇 翻译