:: ============================================================================ :: Copyright and license info is available in the LICENSE file included with :: the Server Deployment Package (SDP), and also available online: :: https://swarm.workshop.perforce.com/projects/perforce-software-sdp/view/main/LICENSE :: ---------------------------------------------------------------------------- @echo off set current_script_dir=%~p0 call %current_script_dir%p4env.bat %1 if errorlevel 1 ( echo Verify incremental aborted - invalid config file found. echo . exit /B 1 ) set LOG=%LOGS_DIR%\p4verify.log set P4USER=%SDP_P4SUPERUSER% set STATUS=OK: All scanned depots verified OK. echo If there are errors in this log, contact support@perforce.com. > %LOG% @call %SCRIPTS_DIR%\p4login.bat >> %LOG% 2>&1 if not %ERRORLEVEL% EQU 0 goto ERROR FOR /F "usebackq tokens=2,4" %%i IN (`%SDP_INSTANCE_BIN_DIR%\p4 depots`) DO call :verify_depot %%i %%j goto check_status :verify_depot set dname=%1 set dtype=%2 set doverify=false IF x%dtype%==xlocal set doverify=true IF x%dtype%==xstream set doverify=true IF x%dtype%==xspec set doverify=true IF x%doverify%==xtrue ( echo === Started verify of %SDP_INSTANCE_P4SERVICE_NAME% //%dname%/... at: >> %LOG% DATE /t >> %LOG% TIME /t >> %LOG% perl %SCRIPTS_DIR%\p4verify.pl //%dname%/... %SDP_INSTANCE_BIN_DIR%\p4 >> %LOG% 2>&1 ) else ( echo Ignoring depot %dname% of type %dtype%>>%LOG% ) goto :EOF :check_status set STATUS= find "BAD" %LOG% > nul if %ERRORLEVEL% EQU 0 SET STATUS=Warning: Verify errors detected. Review the log: %LOG%. find "MISSING" %LOG% > nul if %ERRORLEVEL% EQU 0 SET STATUS=Warning: Verify errors detected. Review the log: %LOG%. find /I "MAX" %LOG% > nul if %ERRORLEVEL% EQU 0 SET STATUS=Warning: Max Limit error detected. Review the log: %LOG%. if "%STATUS%x" == "x" goto SKIP_ERROR :ERROR echo ERROR - ERROR - ERROR - ERROR - ERROR - ERROR - ERROR - ERROR >> %LOG% 2>&1 echo Verify Incremental Failed >> %LOG% 2>&1 echo Verify Incremental Failed - please see %LOG% echo . echo ERROR - ERROR - ERROR - ERROR - ERROR - ERROR - ERROR - ERROR >> %LOG% 2>&1 set ERRORTEXT=Verify Incremental Failed! :SKIP_ERROR TIME /t >> %LOG% echo Operation complete. Sending email. >> %LOG% %SCRIPTS_DIR%\blat.exe -install %mailhost% %mailfrom% %SCRIPTS_DIR%\blat.exe %LOG% -to %maillist% -subject "%COMPUTERNAME% %SDP_INSTANCE_P4SERVICE_NAME% Verification log: %STATUS%" if "%STATUS%x" == "x" ( echo . echo Verify Incremental completed successfully! See %LOG% )