For reasons I'd rather not go into, I have to use dbman on Windows to stop and start a database in a script. It works a treat, except it returns back to the OS that it finished before the database is actually shutdown. According to this KB article https://knowledgebase.progress.com/articles/Article/P136887 there is stuff about this in the documentation, but I can't find it there! Here's my script - would appreciate some help in working out how to wrap a check for the db being down!
call del /Q C:\temp\BackupLog.txt
call c:\Progress\OpenEdge117_64\bin\dbman.bat -database sports -user dbuser -password 111! -stop >> C:\temp\BackupLog.txt
call c:\Progress\OpenEdge117_64\bin\probkup C:\temp\sports C:\temp\SmartDBDelta%date%.bkp incremental -Bp 10 >> C:\temp\BackupLog.txt
call c:\Progress\OpenEdge117_64\bin\dbman.bat -database sports -user dbuser -password 111! -start >> C:\temp\BackupLog.txt
This seems to do the trick actually.
call del /Q C:\temp\BackupLog.txt
call c:\Progress\OpenEdge117_64\bin\dbman.bat -database sports -user dbuser -password 111! -stop >> C:\temp\BackupLog.txt
:loop
call c:\Progress\OpenEdge117_64\bin\proutil C:\temp\sports -C HOLDER >> C:\temp\BackupLog.txt
if %ERRORLEVEL% == 0 goto cont
goto loop
:cont
call c:\Progress\OpenEdge117_64\bin\probkup C:\temp\sports C:\temp\SmartDBDelta%date%.bkp incremental -Bp 10 >> C:\temp\BackupLog.txt
call c:\Progress\OpenEdge117_64\bin\dbman.bat -database sports -user dbuser -password 111! -start >> C:\temp\BackupLog.txt