HP XP7 Storage User Manual
Page 99
REM LOOP:0-2 3Times
SET TIMEOUT=121
REM TIMEOUT 2[minutes]=120[s]
SET TARGETFOLDER=C:\Reports\tmp
SET REPORTFOLDER=C:\Reports
SET RAIDINF_PATH="C:\Program Files\raidinf"
REM
REM Create Report Folder
REM
IF NOT EXIST %REPORTFOLDER% (
MKDIR %REPORTFOLDER%
IF NOT EXIST %TARGETFOLDER% (
MKDIR %TARGETFOLDER%
)
)
SET /a CNT_LOGIN=0
:LOGIN_RETRY
REM ####################################### Login %CNT_LOGIN%
SET /a CNT_LOGIN=%CNT_LOGIN% + 1
%RAIDINF_PATH%\raidinf -login %USER% %PASS% -servername %SERVER%
if ERRORLEVEL 1 (
IF %CNT_LOGIN% GTR %LOOP% GOTO :ABEND
CALL :SLEEP
GOTO LOGIN_RETRY
)
SET /a CNT_DL=0
:DL_RETRY
REM ####################################### Download %CNT_DL%
SET /a CNT_DL=%CNT_DL% + 1
%RAIDINF_PATH%\raidinf download report -servername %SERVER% ^
-report %REPORT_NAME% -targetfolder %TARGETFOLDER%
if ERRORLEVEL 1 (
IF %CNT_DL% GTR %LOOP% GOTO :ABEND
CALL :SLEEP
GOTO :DL_RETRY
)
REM ####################################### Create Error Check
IF EXIST %REPORTFOLDER%\Report_%REPORT_NAME%_1.tgz (
IF EXIST %TARGETFOLDER%\Report_%REPORT_NAME%.tgz (
GOTO :FC_CHECK
) else (
GOTO :CHECK_END
)
) else (
GOTO :CHECK_END
)
:FC_CHECK
FC /B %REPORTFOLDER%\Report_%REPORT_NAME%_1.tgz ^
%TARGETFOLDER%\Report_%REPORT_NAME%.tgz > NUL
if ERRORLEVEL 1 (
REM
) else (
DEL %TARGETFOLDER%\Report_%REPORT_NAME%.tgz
GOTO :END
)
:CHECK_END
REM ####################################### Migrate Reports
IF EXIST %TARGETFOLDER%\Report_%REPORT_NAME%.tgz (
IF EXIST %REPORTFOLDER%\Report_%REPORT_NAME%_2.tgz (
COPY %REPORTFOLDER%\Report_%REPORT_NAME%_2.tgz ^
Managing tasks
99