oracle
@echo off
REM =========================================================
REM "oracle 循环自动备份批处理脚本"
set BACKUP_LOCAL=c:\aa
exp tsg/tsg@testsid file=%BACKUP_LOCAL%\%date:~11,3%.bak
sqlserver
REM =========================================================
REM "qlserver2005 循环自动备份批处理脚本"
set BACKUP_LOCAL=c:\aa
set SERVER_IP=127.0.0.1
set SAPASSWORD=S60INFO2000
set BACKUP_DATABASE=glis7
sqlcmd -S %SERVER_IP% -U sa -P %SAPASSWORD% -d %BACKUP_DATABASE% -Q"BACKUP DATABASE %BACKUP_DATABASE% to disk='%BACKUP_LOCAL%\%date:~11,3%.bak' with format"
echo "%date% %time% 备份 %BACKUP_LOCAL%\%date:~11,3%.bak 成功!" >> %BACKUP_LOCAL%\bakuplog.txt
上传到ftp 服务器
REM =========================================================
REM #备份文件拷贝到异地共享文件夹中
REM #在lj-vmware 中建新用户libsysbak, 密码baklibsys 并且共享 图书馆自动系统数据备份 文件夹
copy /Y %BACKUP_LOCAL%\%date:~11,3%.bak h:\%date:~11,3%.bak
net use h: /delete
REM =========================================================
REM #备份文件拷贝到异地ftp 服务器中 注意put 的目录问题 ,默认为当前目录
echo open 192.168.0.218>ftpcmd.txt
echo infosea>>ftpcmd.txt
echo infosea>>ftpcmd.txt
echo binary>>ftpcmd.txt
echo put %date:~11,3%.bak>>ftpcmd.txt
echo bye>>ftpcmd.txt
ftp -s:ftpcmd.txt ftp > %BACKUP_LOCAL%\bakuplog.txt
exit;