Subject RE: [firebird-support] Backup fdb on Linux
Author Helen Borrie
At 09:44 PM 31/05/2005 +0200, you wrote:
>The path to the database on Jvzlinux (10.0.0.3) as seen from Win 2000 Pro PC
>called JVZ06
>\\Jvzlinux\Primary\files\db\bx
>Contents of a batch file called test.bat in the firebird bin folder on JVZ06
>gbak -b 10.0.0.3:/Primary/files/db/bx/bx.fdb
>10.0.0.3:/Primary/files/db/bx/bx.fbk
>When I run this on JVZ06 nothing happens.

JVZ06 is a remote workstation, so it has to make its request via the
Services Manager and must supply username and password:

gbak -b -se service_mgr:Jvzlinux /Primary/files/db/bx/bx.fdb
/Primary/files/db/bx/bx.fbk -user sysdba -password whatever

That will write the backup file in the host filesystem, provided of course
that the firebird user has permissions to do so AND a file of that name
doesn't already exist there.

Basically, the services manager READS from a *database* that the SERVER can
connect to, and WRITES to a *file* that the host filesystem can access.

If you want instead to write the gbak file to the Windows workstation,
you'll have to mount a share that the firebird user has access to. Then
you can write the backup file to that share. (Shares don't work for
databases, of course, but the backup file is just a file, not a database).

So, let's suppose you've done all the right things on the Windows machine
with the share, passwords and permissions, and you have smbmount-ed
\\Jvzlinux\Primary\files\db\bx to a mount called /mnt/winbackup ...then,
your gbak command would be:

gbak -b -se service_mgr:Jvzlinux /Primary/files/db/bx/bx.fdb
/mnt/winbackup/bx.fbk -user sysdba -password whatever

In real life, it's probably more common to write the gbak file to a
filesystem that's local to the server and to write the log to the
requesting remote workstation. Again, the logfile has to go to a
filesystem-visible location, not a TCP/IP address.

gbak -b -se service_mgr:Jvzlinux /Primary/files/db/bx/bx.fdb
/Primary/files/db/bx/bx.fbk -user sysdba -password whatever -v -y
/mnt/winbackup/latest_backup.log

As before, the logfile name must be unique in the destination location or
you'll get an exception. So you need to build into your bat file the means
to invent fresh names for backup and log files each time it is run.

./heLen