Heim > Artikel > Backend-Entwicklung > 苦于备份网站数据库相当麻烦,还要去ftp导出,所以问问,该怎么处理
苦于备份网站数据库相当麻烦,还要去ftp导出,所以问问
谁做过什么程序,可以一键导出某网站的数据库的数据,,弄成压缩文件,下载
------解决方案--------------------
win 下的嘛? 自己写个bat 文件.来处理. 备份 压缩 复制文件到FTP目录
------解决方案--------------------
::……………………………………………………………………………………………………………………………………………………………………………………………………………………………
:: 版本:BACKDATESYSTEM V1.0
:: 功能:用于系统平台备份程序及数据
:: 特点:按当前日期生成文件名
:: pathback、pathSource、pathdatabase、filename、password、letter(接下行)
:: (接上行)baklogPath、bakdatabase、bakdatatime、baktimeStart分别为(接下行)
:: (接上行)备份路径、源路径、数据库路径、备份文件前缀名、密码 (接下行)
:: (接上行)WinRAR安装盘符、日志路径、数据库名、SQL自动备份时间、文档时间
:: bak_ftpServer、bak_ftpUserName、bak_ftpUserPass为FTP地址、用户及密码
::……………………………………………………………………………………………………………………………………………………………………………………………………………………………
set pathback=F:\WebSiteBack\
set PathSource=E:\WebSite\GjWebSite
:: set pathdatabase=E:\Project\WebSite_AspNet\AspNet_Test008\DB_2005
set filename=Andy_WebSite_
set password=wuyi
set letter=d:
set baklogPath=F:\WebSiteBack\Log\
set baktimeStart=%time:~0,2%%time:~3,2%%time:~6,2%%time:~9,2%
set bakdate=%date:~0,4%%date:~5,2%%date:~8,2%
:: set bakdatabase=dg_gongjiao
:: set bakdatatime=1126
:: ftp 相关参数
:: set bak_ftpServer=200.0.0.0
:: set bak_ftpUserName=test
:: set bak_ftpUserPass=test123456
:: del %pathback%%filename%*.rar
%letter%\Progra~1\WinRAR\WinRAR.exe a -inul -p%password% %pathback%%filename%%bakdate%%baktimeStart% %pathSource%
echo -- 压缩完成,生成%filename%%bakdate%%baktimeStart%.rar …… [%date% %time%] >%baklogPath%log_%bakdate%.txt
:: echo -- 开始上传 …… [%date% %time%] >>%baklogPath%log_%bakdate%.txt
:: echo open %bak_ftpServer% >ftp.andy
:: echo %bak_ftpUserName%>>ftp.andy
:: echo %bak_ftpUserPass%>>ftp.andy
:: echo bin >>ftp.andy
:: 是否以天创建文件夹
:: echo mkdir %bakdate% >>ftp.andy
:: echo cd %bakdate% >>ftp.andy
:: echo mput %pathback%%filename%*.rar >>ftp.andy
:: echo bye >>ftp.andy
:: FTP -s:ftp.andy -i >>%baklogPath%log_%bakdate%.txt
:: del ftp.andy /q
:: rem Xcopy %bak_tmpFile%* %pathback%%filename% /y
:: del %pathback%%filename%*.rar /q /s
:: rd %pathback% /q
:: echo -- 上传完成 [%date% %time%]-- >>%baklogPath%log_%bakdate%.txt
四五年前备份net时的bat,参考!