Backup script

gerie

Member
I want to schedule an offline back-up that runs every week. So I wrote a script. But after stopping the database the script stops running. How can I follow all the necessary steps in order to make my back-up and backup my after image files etcetera.
This is the script I wrote:

set dlc=C:\Progress\OpenEdge
set path=%path%;c:\Progress\OpenEdge\bin
SET RAR=C:\Program Files\WinRAR\Rar.exe
d:
cd d:\exactcs\prod
DEL M:\Productie\bkup\exactcs.bkup /Q
DEL M:\Productie\bkup\exactcs.rar /Q
echo OfflineBackup gemaakt op: %DATE% >>M:\Productie\bkup\OfflineBackup.log
DBMAN -stop -all
wait 60
probkup exactcs M:\Productie\bkup\exactcs.bkup >>M:\Productie\bkup\OfflineBackup.log
CALL "%RAR%" a -ri1:1 M:\Productie\bkup\exactcs.rar M:\Productie\bkup\exactcs.bkup
>>M:\Productie\bkup\offlineBackup.log
DEL M:\Productie\bkup\backupAI.bkf /Q
DEL M:\Productie\bkup\backupAI.rar /Q
C:\WIndows\system32\NTBACKUP.EXE backup "@L:\scripts\BackupAI.bks" /n "System Backup" /d "System Backup" /v:no /r:no
/rs:no /hc: off /m normal /j "Backup" /l:s /f "M:\productie\bkup\BackupAI.bkf"
copy "c:\Documents and Settings\sa-tasks\Local Settings\Application Data\Microsoft\Windows NT\NTBackup\data\*.log"
M:\productie\bkup /y
CALL "%RAR%" a -ri1:1 M:\Productie\bkup\BackupAI.rar M:\Productie\bkup\BackupAI.bkf
>>M:\Productie\bkup\OfflineBackup.log
DBMAN -start -all
rfutil d:\exactcs\prod\exactcs -C aimage begin
call rfutil exactcs -C aimage extent empty L:\AI\exactcs.a9
call rfutil exactcs -C aimage extent empty L:\AI\exactcs.a8
call rfutil exactcs -C aimage extent empty L:\AI\exactcs.a7
call rfutil exactcs -C aimage extent empty L:\AI\exactcs.a6
call rfutil exactcs -C aimage extent empty L:\AI\exactcs.a5
call rfutil exactcs -C aimage extent empty L:\AI\exactcs.a4
call rfutil exactcs -C aimage extent empty L:\AI\exactcs.a3
call rfutil exactcs -C aimage extent empty L:\AI\exactcs.a2
call rfutil exactcs -C aimage extent empty L:\AI\exactcs.a1
 

RealHeavyDude

Well-Known Member
Looks like a Windoze script to me ...

Instead of issuing the Progress commands in the script directly you need to use call, otherwise as the Progress commands are batch routines themselves your script will stop running. This is, AFAIK, a Windoze feature.

call DBMAN -stop -all
and so on ...

To backup the after image extents you just need to copy them to a backup location. You can download excellent templates for scripts handling the after image from http://www.dbappraise.com. They are for *nix but you should be able to change them to Windoze syntax.


HTH, RealHeavyDude.
 

gerie

Member
Looks like a Windoze script, because it is a windoze script. ;-)

It looks like the call argument does the trick. I'm running it now and I hope I finaly got it right.
Thnx RealHeavyDude.
 

gerie

Member
I put an CALL argument before every progress command. Everything works fine except for the actual backup.

CALL DBMAN -stop -all
CALL probkup exactcs M:\Productie\bkup\exactcs.bkup >>M:\Productie\bkup\OfflineBackup.log

If I run the complete script, the db is stopped, but the offline backup is skipped. The rest of the complete script runs as expected.
I then used proenv to run: probkup exactcs M:\Productie\bkup\exactcs.bkup >>M:\Productie\bkup\OfflineBackup.log
That works fine.

Any ideas as to why the probkup is skipped?
I removed the wait between stopping the database and making the backup, because the 60 seconds intervall took forever.
 

RealHeavyDude

Well-Known Member
The problem with DBMAN, if I remember correctly, is that the command returns before the database is actually completely shutdown. So there is no guarantee that the shutdown process has completed successfully when the command returns. Therefore you need to check whether the database is still busy - you can do that with proutil <db-name> -C busy for example - before you start the backup. Did you have a look what's in the log file?

Heavy Regards, RealHeavyDude.
 

gerie

Member
Well after trying a lot of different things, I just cut the script in half. So I'm first stopping the database and then 15 minutes later I'll start a new script that will run the backup command. That works.
 

gerie

Member
:lol: No, I told the script to wait 60 seconds, but after an hour it still said I was waiting 60 seconds. :rolleyes: My perception of 60 seconds differs from the perception of microsoft.
 

gerie

Member
Symantec ships its first NetBackup bundled appliance targeted for enterprise backup; also adds cloud connectors to NetBackup and Backup Exec software and upgrades Enterprise Vault.

??????? Do you own shares? This doesn't seem in anyway related to my question.
 
Top