Bat腳本實現MySQL數據庫SQL文件備份


@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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM