Widnows Batch processing offsite backup data

Source: Internet
Author: User

@echo off
@title Mysql+filebckup
Set Files=d:\backup\%date:~0,10%.rar
Set userdb= "Root"
Set pwddb= "123456"
Set filepath= "D:\wwwroot"
Set ftpfile= "C:\ftp.txt"
Set Ftpname=ftpuser
Set Ftppwd=ftpuser
Set ftpfiles= "%date:~0,10%.rar"
Set ftpdomian= "42.51.153.157"
Set rarpath= "C:\Program Files\winrar"
Set "ymd=%date:~,4%%date:~5,2%%date:~8,2%"
@echo Start Backup Mysql
MD "D:\BACKUP\%YMD%.MYSQ L"
"D:\phpStudy\MySQL\bin\mysqldump.exe"--opt-q-uroot-p123456--default-character-set=utf8 discuz > "D:\backup\% Ymd%.mysql\discuz.sql "
"D:\phpStudy\MySQL\bin\mysqldump.exe"--opt-q-uroot-p123456--default-character-set=utf8 dede > "D:\backup\%Ymd% . Mysql\dede.sql "
"D:\phpStudy\MySQL\bin\mysqldump.exe"--opt-q-u root-p123456--default-character-set=utf8 weixin > "D:\backup\% Ymd%.mysql\weixin.sql "

@echo Start compressing files
C:
CD C:\Program Files\winrar
RAR. EXE a-r-y%files%%ymd%%filespath% D:\wwwroot
@echo Writing to file ftp
@echo%ftpname%>%ftpfile%
@echo%ftppwd%>>%ftpfile%
@echo put%files%%ftpfiles%>>%ftpfile%
@echo bye>>%ftpfile%
@echo Upload%files%.rar file
Ftp-s:%ftpfile% 42.51.153.157
CD C:\Documents and settings\administrator\ desktop
Echo%date% Backup succeeded
Pause

C:\ftp.txt Content

Ftpuser
123456
Put D:\backup\%date:~0,10%.rar
Bye

Widnows Batch processing offsite backup data

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.