Kbase P4365: Backing up multiple databases from a batch file on NT
Autor |
  Progress Software Corporation - Progress |
Acesso |
  Público |
Publicação |
  15/10/2008 |
|
Status: Verified
GOAL:
How to back up multiple databases from a batch file on NT.
FIX:
On NT there are a number of ways to back up multiple databases using a batch file. Within your batch file, you can use either the Progress executables or the Progress batch files.
1) Using the Progress Executables:
Run the executables directly rather than use probkup in the batch file: _dbutil for offline backup, and _mprshut for online.
Here are examples of batch files for offline and online backups of multiple databases:
REM offline.bat
E:\Progress\91C\bin\_dbutil probkup E:\wrk91c\sports E:\wrk91c\backup\sportsbak
E:\Progress\91C\bin\_dbutil probkup E:\wrk91c\test E:\wrk91c\backup\testbak
REM online.bat
E:\Progress\91C\bin\_mprshut E:\wrk91c\sports -C backup online E:\wrk91c\backup\sportsbak
E:\Progress\91C\bin\_mprshut E:\wrk91c\test -C backup online E:\wrk91c\backup\testbak
2. Using the Progress batch file:
Use CALL with the probkup command in the batch file:
REM offline.bat
CALL E:\Progress\91C\bin\probkup E:\wrk91c\sports E:\wrk91c\backup\sportsbak
CALL E:\Progress\91C\bin\probkup E:\wrk91c\test E:\wrk91c\backup\test
REM online.bat
CALL E:\Progress\91C\bin\probkup online E:\wrk91c\sports E:\wrk91c\backup\sportsbak
CALL E:\Progress\91C\bin\probkup online E:\wrk91c\test E:\wrk91c\backup\test
Because probkup is itself a batch file, if you try to use the probkup command in the batch file without using CALL, only the first database in the batch file will be backed up. This is because without an explicit CALL, the called bat file (in this case, probkup) exits once it has run and will not return to the calling bat file (e.g. online.bat). The probkup command for the subsequent databases does not execute, but no errors result. The remaining databases will therefore not be backed up, but no errors appear in the log file to indicate this because the first database backed up correctly. Without actually checking the disk for the backup files, it might seem as though all the databases were backed up, and major problems could result if they need to be restored from disk.
These procedures can be adapted for use with other Progress utilities, e.g. proshut.