Question
· May 22, 2017

How to perform online backup by windows bat?

hi

   I want to online backup one Caché database by windows bat, I find some article from the online documentation about  terminal script and the ^DBACK tool and External Entry Points for ^DBACK,  so I can invoke the External Entry Points for ^DBACK from terminal  script like this:    send: Do BACKUP^DBACK<CR>

Is there other better way for backup database from bat/script?

 

Thanks

Discussion (2)1
Log in or sign up to continue

Cache has different mechanisms for calling in from the OS to start Cache functionality. See http://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY=....

Several other possibilities I've used:

1) Your BAT file creates a "trigger" file (for example: MyTrigger.txt) when you want to do a backup. A Cache routine checks for the existence of the trigger file every five minutes and when the Cache routine notices the file, it deletes the trigger file and does ^DBACK.

2) Your BAT file stops Cache by doing cstop.exe in Intersystem/Cache/bin, then you OS copy the Cache.dat file (Cache namespace/database file), then does cstart.exe. Note: Cache will be DOWN while the copy is being made. You can dirty copy Cache.dat while Cache is running but there's no guarantee your copy DB will not be corrupt.

Tom Fitzgibbon | gototomAtG...l.com | 917-933-1226

While possibly being a bit out of scope for your specific request here, as it seems you may be working on a standalone server, I wanted to point out a recent Community article on "VM Backups and Caché freeze/thaw scripts" containing some useful batch examples too:

https://community.intersystems.com/post/intersystems-data-platforms-and-performance-%E2%80%93-vm-backups-and-cach%C3%A9-freezethaw-scripts

The article also includes discussions on the use of OS authentication for the script etc