set date=%DATE:~0,10%
md D:\sam\BACKUP\%date%
exp app/app@orcl_182 owner=app file=D:\sam\BACKUP\%date%\app.dmp
"C:\Program Files\WinRAR\WinRAR.exe" a -r e:\sam\BACKUP\blog.rar e:\sam\webapps\blog
"C:\Program Files\WinRAR\WinRAR.exe" a -r e:\sam\BACKUP\bbs.rar e:\sam\webapps\lxbbs
"C:\Program Files\WinRAR\WinRAR.exe" a -r e:\sam\BACKUP\app.rar D:\webapps\app
-------------------------------------------------------------------
备注:备份Oracle数据库
@echo off
Rem remove files 3 days before ...
echo wscript.echo dateadd("d",-3,date) > %tmp%\tmp.vbs
for /f "tokens=1,2,3* delims=-" %%i in ('cscript /nologo %tmp%\tmp.vbs') do (
set y=%%i
set m=%%j
set d=%%k
)
if %m% LSS 10 set m=0%m%
if %d% LSS 10 set d=0%d%
set before3days=%y%-%m%-%d%
del /Q /F D:\BACKUP\backfiles\USERMYGPS_%before3days%.dmp
Rem backup files.....
set date=%DATE:~0,10%
rem exp system/shmsa@orcl owner=USERMYGPS file=D:\BACKUP\backfiles\USERMYGPS_%date%.dmp
------------------
备份sql server2000
@echo off
Rem remove files 3 days before ...
echo wscript.echo dateadd("d",-3,date) > %tmp%\tmp.vbs
for /f "tokens=1,2,3* delims=-" %%i in ('cscript /nologo %tmp%\tmp.vbs') do (
set y=%%i
set m=%%j
set d=%%k
)
if %m% LSS 10 set m=0%m%
if %d% LSS 10 set d=0%d%
set before3days=%y%-%m%-%d%
del /Q /F d:\backup\backfiles\EquipManage_%before3days%.dmp
Rem backup files
isql -U sa -P shmsa -S SHMSA-SQL20001 -i local.sql
---- backup files
DECLARE @datestr NVARchar(200)
set @datestr = convert(NVARchar(10),getdate(),120)
DECLARE @filepath nvarchar(200)
set @filepath = 'd:\backup\backfiles\EquipManage_' + @datestr + '.dmp'
BACKUP DATABASE [EquipManage] TO DISK = @filepath WITH NOINIT , NOUNLOAD , NOSKIP , STATS = 10, NOFORMAT