PROBKUP Return Codes:
0 Successful backup
1 Bad device name
2 General none specific error which can mean backup started but was unable to complete at some point OR the user hit control C
3 The server is in the process of shutdown
4 Bad parameter passed, no backup will be performed
- PROBKUP does return a Return Codes in most cases.
- There are other more specific codes that may be possible.
- It is possible to fatal in file IO operations (fail to extend a file) and the program will exit through the message subsystem without returning a return code.
- There are no return codes that will show the Status of the PROBKUP, the database lg file will need to be parsed in order to determine which phase the backup process is currently in.
Windows Example:
@echo off
echo ******************************************************************** >> bkuphist.log
date /T >> bkuphist.log
time /T >> bkuphist.log
SET DLC=C:\prgs
SET PATH=%DLC%\bin:%PATH%
ECHO Database : Delete Old BKUP Files (Already Archived and verified) >> bkuphist.log
del /Q bkup\*
call probkup online test.db .\bkup\test_01.bak -verbose -vs 50000 < input.file >> bkuphist.log
echo %errorlevel% of backup >> bkuphist.log
if %errorlevel% == 0 %then% GOTO BKUPOK
%else% GOTO BKUPNOK
:BKUPOK
call prorest test.db bkup\test_01.bak -vp < input.file >> bkuphist.log
echo %errorlevel% of verify >> bkuphist.log
if %errorlevel% == 0 %then% GOTO ARCHIVE
%else% GOTO BKUPNOK
:BKUPNOK
echo %DATE% %TIME% The online database backup or verification failed !! >> bkuphist.log
REM <Do whatever scripting you need to alert.>
goto ENDPROG
:ARCHIVE
CALL "C:\Program Files\7-Zip\7z.exe" a -tzip archive\mybkup.zip bkup\*
echo %DATE% %TIME% backup verified good to go >> bkuphist.log
goto ENDPROG
:ENDPROG