码迷,mamicode.com
首页 > 数据库 > 详细

Bat脚本实现MySQL数据库SQL文件备份

时间:2016-09-23 18:09:30      阅读:206      评论:0      收藏:0      [点我收藏+]

标签:

@echo off
echo 在线兑奖系统自动备份脚本(请勿关闭) 联系人:  电话:
:loop
set /a "FDate=%date:~,4%%date:~5,2%%date:~8,2%"-5 
if %time:~0,8%==17:06:00 (
if exist "D:\mysql_db_backup\lottery_online_ticket_%FDate%.sql" ( Del /q /a "D:\mysql_db_backup\lottery_online_ticket_%FDate%.sql" )

C:\"Program Files (x86)"\"MySQL\MySQL Server 5.5"\bin\mysqldump.exe --opt -u root --password=admin lottery_online_ticket > D:\mysql_db_backup\lottery_online_ticket_%date:~,4%%date:~5,2%%date:~8,2%.sql
echo 备份完毕 ...

Echo open [ip]>ftp.up
Echo [username]>>ftp.up
Echo [password]>>ftp.up
Echo cd .\ >>ftp.up
Echo binary>>ftp.up
Echo put "D:\mysql_db_backup\lottery_online_ticket_%date:~,4%%date:~5,2%%date:~8,2%.sql">>ftp.up
Echo bye>>ftp.up
FTP -s:ftp.up
del ftp.up /q

echo =============备份等待=============
echo 在线兑奖系统自动备份脚本(请勿关闭) 联系人:  电话:
)
goto loop
@echo on

技术分享

Bat脚本实现MySQL数据库SQL文件备份

标签:

原文地址:http://www.cnblogs.com/login2012/p/5900925.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!