Subject Re: [ib-support] Calling GBAK from my app
Author Helen Borrie
At 02:28 PM 04-04-02 -0800, you wrote:
>I'm working on adding a backup command to my application, and as far as
>I know, the only way to do so is to make a call to the command like
>utility GBAK. I'm not too wild about this, but I guess I don't have
>much other choice. It would be great if IB/FB (and in turn IBObjects)
>had a backup API/component.
>
>Anyway, here's my immediate problem:
>How does my application know where to find GBAK.EXE? It doesn't have
>any knowledge of where it is, and the Firebird Bin directory isn't
>automatically added to the system path when FB is installed, so it's
>necessary to specify the exact path to call it. How have others done
>it?

[ ..Frank replied.. ]

>Any other tips/pointers/cautions about doing this?

If you are using Firebird or IB 6 superserver databases, you can use the
TIBBackup component in your IBO application. It's not a data access
component and won't interfere with the rest of your application. Just make
sure you get the most recent version, though (available through CodeCentral
at community.borland.com) since there were problems with older versions.

As to cautions, etc.....
Remember that backups can only be run by SYSDBA or the database owner.

And, while it's quite OK to run a backup whilst other users are connected,
the same isn't true of Restore with overwrite, so, if your application
enables the ability to restore, be very careful about whom you give SYSDBA
and owner privs.

As a general thing (not just Delphi apps) watch out for security when you
have user apps that can do admin tasks. It is all to easy to steal an
IB/FB database by backing it up to an insecure machine (e.g. a Win9x or ME
client) and restoring it elsewhere with full SYSDBA privs.

I prefer to put Admin tasks in a separate module and to be very picky about
file access.

cheers,
Helen

All for Open and Open for All
Firebird Open SQL Database · http://firebirdsql.org ·
http://users.tpg.com.au/helebor/
_______________________________________________________