此批处理用于游戏服务器,经过严格测试,且正式使用,主要用来完全增量备份数据库,当然.如果你想用这个功能还需要将mysql数据的binlog功能打开,不然你将无法进行增量备份,这是必然的,这只是将数备份出来,至于如何将备份出来的数据远程传送的远程服务器上可以调用ftp的功能,此脚本并未详细说明,不明白的可留言,亦可邮件至jzcxfy@gmail.com
----------------------------------------------------------------------------------------
@echo off
@echo ###################################################################
@echo # RAR backup script to backups.
@echo # BACKUP FOR Mysql City to City(WINDOWS)
@echo # jzcxfy@opkeep.com
@echo ###################################################################
set PATH=C:\"Program Files"\WINRAR;%PATH%
set MYSQLPATH=C:\"Program Files"\MySQL\"MySQL Server 5.0"
set BAKPATH=e:\mysql_bak
set USERNAME=root
set PASSWORD=1234567890
rem 请注意选择备份方式,屏蔽其他不需要的(前面加 rem 即可)
rem 使用mysqldump 方式备份
mkdir %BAKPATH%\data
%MYSQLPATH%\bin\mysqladmin -u%USERNAME% -p%PASSWORD% flush-logs
xcopy /e /c /h /y %MYSQLPATH%\data\mysql-bin.* %BAKPATH%\data
rar a -ag %BAKPATH%\diff\ %BAKPATH%\data\mysql-bin.*
rmdir /s /q %BAKPATH%\data\
@echo %date% %time% dIncremental bakup finish >> C:/mysqlbakup.log
----------------------------------------------------------------------------------------
本文原链接:http://opkeep.com/database/mysql/win_flush-logs_bak.html
如不明白可以留言