@echo off setlocal set WORKPATH=%~dp0 call :GENTIMESTAMP set LOG=%WORKPATH%ESECHECK_%DATESTAMP%_%TIMESTAMP%.log set ESEPATH=C:\Programme\Exchsrvr\bin set DBPATH=D:\Exchsrvr\mdbdata set TEMPPATH=D:\TEMP
echo.>>%LOG% echo *** %0 started %DATESTAMP% %TIMESTAMP% *****************************>>%LOG% echo.>>%LOG% call :STOPSERVICE call :RECOVERY call :INTEGRITY priv1 call :INTEGRITY pub1 call :DEFRAG priv1 call :DEFRAG pub1 call :STARTSERVICE call :GENTIMESTAMP echo *** %0 finished %DATESTAMP% %TIMESTAMP% *****************************>>%LOG% endlocal goto :EOF
:RECOVERY echo *** %0 %1 *****************************>>%LOG% %ESEPATH%\eseutil.exe /r E00 /l%DBPATH% /s%DBPATH% /d%DBPATH% /o>>%LOG% echo *** %0 ERRORLEVEL %ERRORLEVEL%>>%LOG% echo.>>%LOG% goto :EOF
:INTEGRITY echo *** %0 %1 *****************************>>%LOG% set WORKDB=%1 %ESEPATH%\eseutil.exe /g %DBPATH%\%WORKDB%.edb /S%DBPATH%\%WORKDB%.stm /t%WORKDB%_INTEGRITY_%DATESTAMP%_%TIMESTAMP%.edb /o>>%LOG% echo *** %0 %1 ERRORLEVEL %ERRORLEVEL%>>%LOG% echo.>>%LOG% goto :EOF
:DEFRAG echo *** %0 %1 *****************************>>%LOG% set WORKDB=%1 %ESEPATH%\eseutil.exe /d %DBPATH%\%WORKDB%.edb /s%DBPATH%\%WORKDB%.stm /t%WORKDB%_DEFRAG_%DATESTAMP%_%TIMESTAMP%.edb /o>>%LOG% echo *** %0 %1 ERRORLEVEL %ERRORLEVEL%>>%LOG% echo.>>%LOG% goto :EOF
:STOPSERVICE echo *** %0 %1 *****************************>>%LOG% net stop MSExchangeIS>>%LOG% echo *** %0 ERRORLEVEL %ERRORLEVEL%>>%LOG% echo.>>%LOG% goto :EOF
:STARTSERVICE echo *** %0 %1 *****************************>>%LOG% net start MSExchangeIS>>%LOG% echo *** %0 ERRORLEVEL %ERRORLEVEL%>>%LOG% echo.>>%LOG% goto :EOF
:GENTIMESTAMP rem ************************************************************************** rem *** Generiert Datum und Uhrzeit in umgekehrter Notation *** rem ************************************************************************** for /F "tokens=1,2 delims= " %%i in ('date /t') do call :BUILDDATESTAMP %%i %%j for /F "tokens=1,2,3 delims=: " %%i in ('time /t') do call :BUILDTIMESTAMP=%%i %%j %%k goto :EOF
:BUILDDATESTAMP rem ************************************************************************** rem *** Baut das Datum zusammen (Fallunterschiedung Deutsch / Englisch) *** rem ************************************************************************** if .%2==. (set ANLAYSEDATE=%1) else (set ANLAYSEDATE=%2) if .%ANLAYSEDATE:~2,1%==./ for /F "tokens=1,2,3 delims=/" %%i in ("%ANLAYSEDATE%") do set DATESTAMP=%%k%%i%%j if .%ANLAYSEDATE:~2,1%==.. for /F "tokens=1,2,3 delims=." %%i in ("%ANLAYSEDATE%") do set DATESTAMP=%%k%%j%%i goto :EOF
:BUILDTIMESTAMP rem ************************************************************************** rem *** Baut die Uhrzeit zusammen (Fallunterscheidung Deutsch / Englisch) *** rem ************************************************************************** set TIMEHH=%1 set TIMEMM=%2 set TIMEAP=%3 if .%TIMEMM:~2,1% NEQ . set TIMEAP=%TIMEMM:~2,1%& set TIMEMM=%TIMEMM:~0,2% if .%TIMEHH:~1,1%==. set TIMEHH=0%TIMEHH% set TIMESTAMP=%TIMEAP%%TIMEHH%%TIMEMM% set TIMESTAMP=%TIMESTAMP: =% goto :EOF
|