Full-standby batch processing under win
Batch processing is used for game servers, rigorously tested and formally used, and is used primarily to fully back up the database, of course. It's just a few backups.
, the function of FTP can be invoked on a remote server that remotely transmits the backed-up data, which is not described in detail and does not understand
Can be message, can also mail to jzcxfy@opkeep.com
The code is as follows |
Copy Code |
@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 Please be careful to choose the backup mode, shielding other unwanted (front plus REM)
REM Backup using Mysqldump method
code is as follows |
copy code |
mkdir%bakpath%\data
%mysqlpath%\bin\mysqldump-u%username%-p%password%--single-transaction--default- Character-set=utf8--flush-logs--master-data=2--delete-master-logs spirit_beast >% Bakpath%\data\spirit_beast%date:~0,10%.sql
%mysqlpath%\bin\mysqldump-u%username%-p%password%--single-transaction--default- Character-set=utf8--flush-logs--master-data=2--delete-master-logs quartz_event >% Bakpath%\data\quartz_event%date:~0,10%.sql
RAR A-ag%bakpath%\full\%bakpath%\data\*.sql
RMDIR/S/q%bakpath%\data\
@echo%date%%time% full bakup finish >> C:/mysqlbakup.log |
Incremental backup batch under win
This batch is used for game servers, rigorously tested and formally used, and is used primarily for full incremental backup of the database, of course. If you want to use this
Features also need to open the MySQL data binlog function, or you will not be able to make incremental backups, which is inevitable, this is just a few backup
Out, as for how to remote transfer of data backed up remote server can invoke the function of FTP, this script does not specify, not
Understand the message, but also mail to jzcxfy@opkeep.com
The code is as follows |
Copy Code |
@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 Please be careful to choose the backup mode, shielding other unwanted (front plus REM) REM Backup using Mysqldump method 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 |
After doing this, we can simply add a scheduled task to Windows to achieve a scheduled backup.