Merged r6969 from RB-1.0 to address #535 and #537

git-svn-id: http://locode01.ad.dom/svn/WEBMIP/trunk@6972 248e525c-4dfb-0310-94bc-949c084e9493
This commit is contained in:
hardya
2008-10-02 09:51:33 +00:00
parent 456f02a123
commit 49bcb35244

View File

@@ -1,4 +1,4 @@
REM $Id:$ REM $Id$
REM REM
REM Use Oracle data pump to export data, zip the dump file and then move it to the REM Use Oracle data pump to export data, zip the dump file and then move it to the
@@ -24,8 +24,37 @@ erase %logfile%
expdp 'sys/fmdidgad@webmip as sysdba' parfile=parfile_data.expdp expdp 'sys/fmdidgad@webmip as sysdba' parfile=parfile_data.expdp
cmd /c /wait "start /low zip %zipfile% %dmpfile% %logfile%" cmd /c start "7-zip files - started %TIME%" /wait /low 7z a %zipfile% %dmpfile% %logfile%
mkdir %destdir% mkdir %destdir%
move /Y %zipfile% %destdir% && erase %dmpfile% move /Y %zipfile% %destdir% && erase %dmpfile%
REM
REM Remove the previous months matching backup
REM
if %mm% LSS 10 (
set tmpmm=%mm:~1,1%
) else (
set tmpmm=%mm%
)
set /a prevmm=%tmpmm% - 1
if %prevmm% LEQ 0 (
set prevmm=112
) else (
set /a prevmm=100 + %prevmm%
)
if %prevmm% EQU 112 (
set /a yyyy=%yyyy% - 1
)
set prevmm=%prevmm:~1,2%
set prevzipfile=webmip_expdp_%yyyy%-%prevmm%-%dd%-%hr%.zip
set prevdestdir=%destbasedir%\%yyyy%-%prevmm%
echo erase %prevdestdir%\%prevzipfile% >> c:\erase_log.txt
erase %prevdestdir%\%prevzipfile%