Subject Re: [ib-support] Backups
Author Andy Canfield
My (working) command line under Windows 98 SE:
gbak -B -USER SYSDBA -PASSWORD masterkey -VERIFY D:\Database\OOP.GDB OOP.GBK
-B means backup
-USER SYSDBA (that's who owns the database)
-PASSWORD masterkey (it maybe has to be included on the command line
-VERIFY (I forget why but it sounds nice)
D:\Database\OOP.GDB = the database name. I suspect that gbak.exe must run on the machine where the database is.
OOP.GBK = the name of the output backup file.

If I create any batch file in Windows 98, I right-click on it and set properties Memory to Auto + Protected and Initial Environment to 2048; the default "Auto" never worked for me. Yeah, the default behavior screws up; but the default behavior of Microsoft is to screw up; like coders like code.

You write "I then instead wrote out a batch file. In it I set ISC_USER and ISC_PASSWORD and then call gbak. The problem with this is that it pops up a MSDOS window showing the command running (and the password in plain text!) ". You can hide it like this:
@echo off
gbak -B -USER SYSDBA -PASSWORD masterkey -etc
and it won't appear on the screen. But you will still have an ASCII text file on the hard disk containing the password in plain text. An alternative is to use a DOS program I have (write to andy@... and I'll send you a copy) that will take a string from the keyboard and put it in an environment variable. While you're typing it will appear on the screen but it can then be erased like this:
@echo off
set U=SYSDBA
getkey /s Password for %U%?
cls
gbak -B -USER %U% -PASSWORD %GETKEY% -etc.
set GETKEY=

Hope that helps.

----- Original Message -----
From: "Brad Pepers" <brad@...>
To: <ib-support@yahoogroups.com>
Sent: Wednesday, June 06, 2001 01:44
Subject: [ib-support] Backups


> I was wondering just what the options are in Windows for doing backups. I
> have a backup function in my software which works well in Linux by calling
> gbak but I can't figure out the Windows side of things. Here is what I've
> tried:
>
> 1. At first I used system() on Windows just like Linux but this seems to have
> limitations. It seems to have a very limited command line length and perhaps
> not like spaces in the program name. Its hard to tell really whats failing
> though since there is no output I can see (I like on Linux that I can run
> from an xterm and see the gbak output if it fails but I can't see a way to do
> this on Windows).
>
> 2. I then instead wrote out a batch file. In it I set ISC_USER and
> ISC_PASSWORD and then call gbak. The problem with this is that it pops up a
> MSDOS window showing the command running (and the password in plain text!)
> and besides that the screen shows an error that its out of environment space
> anyway so the backup fails this way too! Not very professional looking...
>
> 3. There is the backup function in the services interface but this does the
> backup on the server when I want it to write to a file on the local
> filesystem.
>
> The only other thing I can think of is to write my own backup program but
> that would really not be nice!
>
> Are there any other ways to execute an external program in Windows that may
> not be sensitive to spaces and command line lengths and such? I'm a Linux
> programmer and am finding it very hard to get used to how hard it is to do
> some really simple things in Windows!
>
> How does the IB console do backups?
>
> --
> Brad Pepers
> brad@...
>
> To unsubscribe from this group, send an email to:
> ib-support-unsubscribe@egroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>