備份次新的DR(sql server dmp檔案)

fjzcau發表於2015-02-08
#----------------------F:\CVDR\scripts\cvdr2169.bat-------------------#
@echo off

set folder=F:\CVDR
set tempfile="%tmp%\fjz.tmp"

del/a/f/q %tempfile%

for /f "usebackq delims=" %%A in (`dir /ad /od /tc /b "%folder%"`) do (
         echo %%A>>%tempfile%
         set newest_folder=%%A
)
for /f "usebackq delims=" %%A in (`type %tempfile%^|find /v "%newest_folder%"`) do set second_newest_folder=%%A
echo second_newest_folder=%second_newest_folder%

del/a/f/q %tempfile%

cd /d %folder%\%second_newest_folder%

forfiles /p %folder%\%second_newest_folder% /m *.dmp /c "cmd /c copy @path d:\cvdr_to_16.9"

cd /d d:\cvdr_to_16.9

C:\Windows\System32\ftp.exe -s:F:\CVDR\script\cvdr2169_ftp.txt


#-----cvdr2169_ftp.txt ---#
open 10.242.16.9
cvdr
cvdr
bin
prom
mput *.dmp
bye

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22661144/viewspace-1430678/,如需轉載,請註明出處,否則將追究法律責任。

相關文章