Firebird Gbak
Firebird Gbak
Firebird Gbak
Norman Dunbar
1 may 2013 - Document version 1.11
Table of Contents
Introduction ........................................................................................................................................... 3
Command-line Options ........................................................................................................................... 3
Common Options ........................................................................................................................... 3
Backup Switches ............................................................................................................................ 8
Restore Switches .......................................................................................................................... 10
Backup Mode ....................................................................................................................................... 13
Speeding up the Backup ............................................................................................................... 14
Restore Mode ....................................................................................................................................... 14
Restore Or Recreate? .................................................................................................................... 15
Malformed String Errors During Restores ...................................................................................... 15
Speeding up the Restore ............................................................................................................... 16
Security Of Backups ............................................................................................................................ 16
Backup & Restore Recipes ................................................................................................................... 17
Backup & Restore Prerequisites .................................................................................................... 17
A Simple Backup & Restore ......................................................................................................... 17
Meta Data Only ........................................................................................................................... 17
Splitting The Backup .................................................................................................................... 18
Change The ODS ......................................................................................................................... 18
Change The Cache Size ................................................................................................................ 19
Change The Page Size .................................................................................................................. 19
Create A Read-Only Database Clone ............................................................................................. 20
Create a Database Clone Without a Dump File. ............................................................................. 20
Backup & Restore With & Without Shadow Files. ......................................................................... 21
Remote Backups & Restores ......................................................................................................... 22
Remote Backups and Restores Using SSH ..................................................................................... 23
Using External Tools .................................................................................................................... 24
Gbak Caveats ....................................................................................................................................... 25
Gbak Default Mode ...................................................................................................................... 25
Normal Versus Privileged Users ................................................................................................... 26
Silent Running? ............................................................................................................................ 26
Gbak log file Cannot Be Overwritten ............................................................................................ 26
Use of 'stdin' or 'stdout' File Names .............................................................................................. 26
Appendix A: Document history ............................................................................................................ 28
Appendix B: License notice .................................................................................................................. 30
Introduction
Gbak is one of the database backup and restore utilities supplied with Firebird. In Firebird 1.5 it is the only supplied utility of this kind while Firebird 2.x also has the nbackup utility which is described in another document.
In this manual, we will discuss:
Command-line Options
Common Options
When running gbak in backup or restore mode, there are a number of options which apply to either mode. These
are:
-?
This switch displays the command line options and switches. It replaces the old method in which you had to
supply an invalid switch (see -help below) in order to see the list of valid ones.
Note
Firebird 2.5 onwards.
-M[ETA_DATA]
This switch causes your data to be ignored and not backed up or restored. In a backup, only the database
meta data are backed up. When used in a restore, any data in the dump file will not be restored. This switch
can be used when creating database clones which are required to contain only the tables, indices etc but none
of the data.
Warning
The log file must not exist. If it does, the backup or recovery operation will fail:
tux> rm employee.log
tux> gbak -backup employee.fdb employee.fbk -y employee.log -v
tux> ls -l employee.log
-rw-r--r-- 1 firebird firebird 21610 2010-08-04 10:22 employee.log
tux> gbak -backup employee.fdb employee.fbk -y employee.log -v
gbak:cannot open status and error output file employee.log
-Z
This option displays some information about the version of gbak being used, and optionally, a database. To
obtain the version of gbak only, run the command as follows:
tux> gbak -z
gbak:gbak version LI-V2.5.0.26074 Firebird 2.5
gbak: ERROR:requires both input and output filenames
gbak:Exiting before completion due to errors
tux> echo $?
1
This displays the current version of gbak, and after displaying a couple of error messages, exits with an error
code of 1 as shown above by the echo command. This method does not attempt to backup any databases and
does not require a username and password to be defined or supplied.
If you wish to display the version number of the gbak utility and also details of database, you must supply
a valid database name and backup filename, as follows:
tux> gbak -z employee employee.fbk -user sysdba -password secret
gbak:gbak version LI-V2.1.3.18185 Firebird 2.1
gbak:
Version(s) for database employee
Firebird/linux (access method),version LI-V2.1.3.18185 Firebird 2.1
Firebird/linux (remote server),version LI-V2.1.3.18185
Firebird 2.1/tcp (tux)/P11
Firebird/linux (remote interface), version LI-V2.1.3.18185
Firebird 2.1/tcp (tux)/P11
on disk structure version 11.1
tux> echo $?
0
You will note from the above that a valid username and password must be defined on the command line, or
by the use of environment variables ISC_USER and ISC_PASSWORD. This version of the command will
exit with a error code of zero.
Warning
This method of calling gbak will make a backup of the database. If your database is large, this can take some
time to complete and the backup file specified will be overwritten if it already exists. Beware.
Note
The output above has been slightly abbreviated to allow it to fit the page width for a pdf.
-help
Help is actually not a valid option, but can be used to display the following screen of information as output
from gbak in Firebird 2.0:
gbak:legal switches are:
-B[ACKUP_DATABASE]
-BU[FFERS]
-C[REATE_DATABASE]
-CO[NVERT]
-E[XPAND]
-FA[CTOR]
-G[ARBAGE_COLLECT)
-I[NACTIVE]
-IG[NORE]
-K[ILL]
-L[IMBO]
-M[ETA_DATA]
-MO[DE] <access>
-N[O_VALIDITY]
-NOD[BTRIGGERS]
-NT
-O[NE_AT_A_TIME]
-OL[D_DESCRIPTIONS]
-P[AGE_SIZE]
-PAS[SWORD]
-R[ECREATE_DATABASE]
-REP[LACE_DATABASE]
-RO[LE]
-SE[RVICE]
-T[RANSPORTABLE]
-USE_[ALL_SPACE]
-USER
-V[ERIFY]
-Y <path>
-Z
Note
The explanation of the -m[eta_data] switch implies that it is useful in a backup situation only. This is not
the case as it can also be used on a restore.
From Firebird 2.5 onwards, there is a new -? switch to display the list of valid options. The output has slightly
different layout and a couple of new options have been added:
6
The parentheses shown in the above indicates how much of the switch name you need to use in order to avoid
ambiguity. Once you have specified the absolute minimum - the part before the opening '[' - you can use as much
of what follows as you wish. For example, to use the -b[ackup_database] switch the minimum you must
supply on the command line is -b but anything between -b and -backup_database will be accepted.
Using the -help switch like this, or any other invalid switch, will cause gbak to exit with an error code of 1
on Linux and Windows.
Backup Switches
Note
When running gbak, if the first filename is a database name, or database alias then gbak will default to taking
a backup of the database in transportable format. The backup file will be named as per the second file name
supplied on the command line.
Note
You may, if you wish, send the output to standard output rather than a backup file. In this case, you must specify
stdout as the dump file name. This is not really of much use, unless you wish to pipe the dump through a tool to
modify it in some way. You can pipe the output directly to a gbak restore operation to clone a database without
needing an intermediate dump file. An example is given later in this manual.
When carrying out a backup of a database, the following switches, in addition to the common ones above, will
be of use:
-B[ACKUP_DATABASE]
This switch is used whenever you wish to take a backup of a database.
-CO[NVERT]
This switch causes any tables, defined as external, to be backed up as if they were normal (non-external)
tables. When this dump file is used to restore a database, the tables that were external in the original database
will no longer be external.
-E[XPAND]
Normally, gbak will compress the output file. This switch prevents that compression from taking place.
-FA[CTOR] <block size>
If backing up to a physical tape device, this switch lets you specify the tape's blocking factor.
-G[ARBAGE_COLLECT]
The use of this switch prevents Firebird's garbage collection from taking place while gbak is running. Normally gbak connects to the database as any other connection would and garbage collection runs normally.
Using this switch prevents garbage collection from running during the course of the backup. This can help
speed up the backup.
-IG[NORE]
This switch causes gbak to ignore bad checksums in the database. This can be used to attempt to backup a
database that failed due to checksum errors. There is no guarantee that the data will be usable though, so it
is best to take other precautions to preserve your data.
-L[IMBO]
-T[RANSPORTABLE]
The default dump file format is transportable. Transportable backup files are written in a format known as
external data representation (XDR) format and it is this format which allows a dump taken on a server of
one type to be successfully restored on a server of another type.
-USER <username>
See above.
-V[ERIFY]
See above.
Restore Switches
Note
When running a gbak command, if the first filename is a database backup file name then gbak will default to running a recovery of the database provided that you specify one of -c[create database], rep[lace_database] or -r[ecreate_database] in order to make your intentions clear. The database
will be restored to whatever file name is specified as the second file name on the command line..
Note
You may, if you wish, read the dump data directly from standard input rather than a backup file. In this case,
you must specify stdin as the dump file name. You could pipe a gbak dump operation directly to a gbak restore
operation to clone a database without needing an intermediate dump file. An example is given later in this
manual.
When carrying out a restore or replacement of a database, the following switches, in addition to the common
ones above, will be of use:
-BU[FFERS] <number of buffers>
This switch sets the default database cache size (in number of database pages) for the database being restored.
If a database is being overwritten then this setting will overwrite the previous setting for the cache size.
-C[REATE_DATABASE]
This switch causes a new database to be created from the backup file. The database file must not exist or
the restore will fail. Either this switch or -rep[lace_database] or -r[ecreate_database] must
be specified.
-FIX_FSS_D[ATA]
This switch forces gbak to fix malformed UNICODE_FSS character data during a restore.
This switch, and the following one, should not be required under normal circumstances. However, if a restore
operation fails with a "malformed string" error, the message output from gbak will refer the user to one or
both of these switches to fix the malformed UNICODE_FSS data or meta data as appropriate.
Note
Firebird 2.5 onwards.
-FIX_FSS_M[ETADATA]
This switch forces gbak to fix malformed UNICODE_FSS metadata during a restore.
This switch, and the preceding one, should not be required under normal circumstances. However, if a restore
operation fails with a "malformed string" error, the message output from gbak will refer the user to one or
both of these switches to fix the malformed UNICODE_FSS data or meta data as appropriate.
10
Note
Firebird 2.5 onwards.
-I[NACTIVE]
This switch can be used to restore a database when a previous restore attempt failed due to index errors. All
indexes in the restored database will be inactive.
-K[ILL]
This switch restores the database but doesn't recreate any shadow files that existed previously.
-M[ETA_DATA]
See above.
-MO[DE] <access>
This switch allows the database being restored to be set to the given access mode when opened. By default,
the mode is taken from the database that was dumped.
-N[O_VALIDITY]
This switch is similar to the -i[nactive] switch above, except, it disabled all check constraints in the
restored database.
-NOD[BTRIGGERS]
New switch from Firebird 2.1 which prevents the database triggers from firing on a restore. Database triggers
are a new feature in Firebird 2.0 onwards and are different from table triggers which will continue to fire.
-O[NE_AT_A_TIME]
This switch causes the restore to restore one table at a time. This can be useful when a previous restore failed
due to data errors. Normally, a restore takes place in a single transaction with a single commit at the end
of the restore. If the restore is interrupted for any reason, an empty database is the end result. Using the o[ne_at_a_time] option uses a transaction for each table and commits after each table has been restored.
-P[AGE_SIZE] <new page size>
Use this switch to change the default database page size. By default, the database is restored using a page
size the same as the one that was in use when the database was dumped.
-PAS[SWORD] <password>
See above.
-R[ECREATE_DATABASE] [O[VERWRITE]]
New from Firebird 2.x. Create (or replace if o[verwrite] is used) the named database from the backup file.
The database filename should not already exist or an error will occur. This is not the case if the o[verwrite]
option is also used.
11
o[verwrite]
is
effectively
the
same
as
using
-REP[LACE_DATABASE]
Replace database from backup file. This switch used to be abbreviated to -r in previous (to Firebird 2.x)
versions. This switch will be removed in a version of Firebird later than 2.1.3 (where it still exists). You are
advised to use the -r[ecreate_database] o[verwrite] switch instead.
-SE[RVICE] <servicename>
Use the services manager on a remote database to restore a remote database. The servicename is currently
always the text service_mgr.
Note
You can use this option to connect to a locally hosted database as well. If you do, restoring a backup using
this option can run quicker than accessing the database directly. See the section below on speeding up
restores.
-USE_[ALL_SPACE]
This switch forces the restore to use 100% of each database page and thus not leave any room for changes.
If you omit this switch, some space will be kept free for subsequent changes. Using this switch is likely to
be only of practical use where the database is created and used in read-only mode and no updates to existing
data are required.
Warning
Once a database has been restored with this option specified, all database pages will be filled to 100% and
no free space will be left for updates. Use of this switch set a flag in the database header page to signal that
all pages are to be filled to 100% - this applies to any new pages created after the restore.
You can override this setting, using gfix -use full | reserve database_name where full uses 100% of
each page and reserve reserves some space for subsequent updates. See the gfix manual for more details.
-USER <username>
See above.
-V[ERIFY]
See above.
-Y <name of log file>
See above.
12
Backup Mode
Before you consider using other tools to take a backup of your Firebird database, make sure that you know
what the tools do and how a running database will be affected by them. For example, if you use Winzip to
create a compressed copy of a database and you do it when users are accessing the system, the chances of a
successful restore of that database are slim. You must either always use the gbak or nbackup tools which know
how the database works, or, use gfix to shut the database down completely before you even attempt to backup
the database file(s).
Gbak creates a consistent backup of the database by starting a transaction that spans the backup period. When
the backup is complete, the transaction is ended and this means that the backup process can be run while users
are working in the database. However, any transactions started after the backup process begins will not have
any of the changed data written to the backup file. The backup will represent a copy of the entire database at
the moment the backup began.
The dump file created by a default gbak backup is cross platform (transportable) so a backup taken on a Windows
server can be used to recreate the same database on a Linux server, or on any other platform supported by
Firebird. This is not true of the copies of your database taken (while the database was closed!) with tools such as
Winzip etc. Those copies should only ever be used to restore a database on the same platform as the one copied.
Important
Always backup the database with the version of gbak supplied with the running database server.
And one final thought on backups, regardless of the fact that the backup finished with no errors, exited with an
error code of zero and all appears to be well, how do you actually know that the backup file created is usable?
The short answer is, you don't. Whenever you have a valuable database - and they all should be - you are strongly
advised to take your backup files and use them to create a test restore of a database either on the same server or
even better, on a different one. Only by doing this can you be certain of a successful backup.
The following example shows a backup being taken on a server named linux and used to create a clone of the
database on another Linux server named tux to make sure that all was well. First of all, the backup on linux:
linux> gbak -backup -verify -y backup.log employee employee.fbk
linux> gzip -9 employee.fbk
Note
Note that the above gbak command can be written as follows, leaving out the -b[ackup] switch as gbak
defaults to running a backup when no other suitable switches are specified:
linux> gbak -verify -y backup.log employee employee.fbk
13
At this point, the restore has worked and has overwritten the previous database known as employee.restore.test.
The actual location of the database for the database employee.restore.test is defined in the aliases.conf file
in /opt/firebird on the server. In this test, it resolves to /opt/firebird/databases/employee.
restore.fdb.
For further proof of reliability, the application may be tested against this clone of the live database to ensure
all is well.
The second option is to backup the database using the -se[rvice] option. Although this is used to perform
remote backups, it can be used locally as well. Using this option can help speed up your backups. It simply
avoids the data being copied over the TCP network which can slow down the actions of the backup.
tux> gbak -backup -service tux:service_mgr employee /backups/employee.fbk
The example above backs up the employee database, on the tux server, "remotely" using the service manager.
The tux server is, of course, where the command is running, so it isn't really running remotely at all.
You can, of course, combine the -g[arbage_collect] and -se[rvice] options.
Restore Mode
Backups taken with the gbak application from one version of Firebird - or InterBase - can be used by later
versions of Firebird to restore the database, however, while this may result in an upgrade to the On Disc Structure
(ODS) for the database in question, the SQL Dialect will never be changed. If you backup an InterBase dialect
1 database and then use the dump file to recreate it under Firebird 2.1, for example, the ODS will be updated
to 11.1 but the SQL Dialect will remain as 1.
Important
Always restore the database with the version of gbak supplied with the database server you wish to run the (new)
database under. However, gbak from Firebird 2.1 can be used to restore a database onto any version of Firebird.
You can, if you wish, change the SQL Dialect using gfix.
14
Restore Or Recreate?
Should a database be restored or replaced? Restoring a database is the process by which you take the existing file and delete prior to replacing it on disc with a backup copy. Gbak does this when you specify the r[ecreate_database] o[verwrite] switch or the -rep[lace_database] switch. What is the difference?
If a database exists on disc and you ask gbak to restore it using one of the two switches above, you might corrupt
the database especially if the database is in use and has not been shut down using gfix. In addition, if you have
only partially completed the restore of a database, and some users decide to see if they can login, the database
may well be corrupted.
Finally, if the restore process discovers that the dump file is corrupt, the restore will fail and your previously
working database will be gone forever.
It can be seen that restoring a database can be a fraught experience.
For security, always recreate the database with a new name - a clone - and update the aliases.conf to
reflect the new name. This way, your users will always refer to the database by the alias regardless of the actual
filename on the server.
The example above backs up the employee database, on the tux server, "remotely" using the service manager.
The tux server is, of course, where the command is running, so it isn't really running remotely at all.
You can, of course, combine the -g[arbage_collect] and -se[rvice] options.
Security Of Backups
As you have seen above anyone, with a valid username and password, can restore a gbak database dump file
provided that they are not overwriting an existing database. This means that your precious data can be stolen
and used by nefarious characters on their own servers, to create a copy of your database and see what your sales
figures, for example, are like.
To try and prevent this from happening, you are advised to take precautions. You should also try and prevent
backups from being accidentally overwritten before they have expired. Some precautions you can take are:
Always set the dump file to be read-only after the backup is complete. This helps prevent the file from being
overwritten.
Alternatively, incorporate the date (and time?) in your backup filenames.
Keep backups in a safe location on the server. Storing backups in a location with restricted access helps
reduce the chances of your backup files 'escaping' into the wild.
Keep tape copies of your backups very secure. A locked safe or off-site location with good security is advisable. The off-site location will also be of use after a total disaster as the backups are stored in a separate
location to the server they are required on.
Backup to a partition or disc that has encryption enabled.
Make sure that only authorised staff have access to areas where backups are kept.
Always test your backups by cloning a database from a recent backup.
In Firebird 2.1, there is an additional security feature built into gbak and all the other command-line utilities.
This new feature automatically hides the password if it is supplied on the command line using the -password
switch. Gbak replaces the password with spaces - one for each character in the password. This prevents other
users on the system, who could run the ps command and view your command line and parameters, from viewing
any supplied password. In this manner, unauthorised users are unable to obtain the supplied password.
tux> gbak -b -user SYSDBA -passw secret employee /backups/employee.fbk
tux> ps efx| grep -i gba[k]
20724 ... gbak -backup -user SYSDBA -passw
... (lots more data here)
employee employee.fbk
You can see from the above that the password doesn't show up under Firebird 2.1 as each character is replaced
by a single space. This does mean that it is possible for someone to work out how long the password could be
16
The example above prevents any new transaction from being started which prevents new queries being executed
or new sessions connecting to the database. It will wait for up to 60 seconds for everyone to logout and for all
current transactions to complete before shutting down the database. If any long running transactions have not
completed by the end of 60 seconds, the shutdown will timeout and the database will remain open.
Note
After the restore of the database has completed, the database will automatically be opened again for use.
When the above dump file is restored on the production server, only the meta data will be present.
There is another way to create a database with no data and only the meta data. Simply restore from an existing
dump which contains the data and supply the -m[eta_data] switch to the restore command line. The database
will be restored but none of the original data will be present.
tux> #Restore only the database metadata.
tux> gbak -create employee.fbk mytest.fdb -meta_data
The -m[eta_data] switch can be used on either a backup or a restore to facilitate the creation of a clone
database (or overwrite an existing one) with no actual data.
The sizes after each filename indicate how large that particular file is allowed to be. The default size is bytes,
but you can specify a suffix of k, m or g to use units of kilo, mega or gigabytes.
If the dump completes before writing to some files, then those files are not created. A dump file is only ever
created when it must be.
The size of the final dump file will be quietly ignored if the database has grown too large to allow a truncated
backup to complete. If, in the example above, the backup needs a total of 1500M, then the last file would be
written to a final size of 900m rather than the 600m specified.
To restore such a multi-file backup requires that you specify all of the filenames in the dump and in the correct
order. The following example shows the employee database above being restored from the two files dumped
above:
tux> # Restore the database from multiple files.
tux> gfix -shut -tran 60 employee
tux> gbak -replace /backups/employee.a.fbk /backups/employee.b.fbk employee
After the above, the old 2.0 Firebird database will have been recreated - wiping out the old database - as a
Firebird 2.1 database with the corresponding upgrade to the ODS from 11.0 to 11.1.
The script setenv_firebird is not supplied with Firebird and simply sets PATH etc to use the correct version
of Firebird as per the supplied parameter.
The default cache size is used when the number of buffers is zero, as in the first example above. Gbak allows this
to be changed if desired. Gbak, however, cannot set the cache size back to zero. You must use gfix to do this.
19
You will notice that the output file name for the backup is stdout and the input file name for the restore is
stdin. This ability to pipe standard output of one process to the standard input of another, is how you can avoid
creating an intermediate dump file. The commands above assume that there are suitable alias names set up for
both emptest and emptest_2. If not, you will need to supply the full path to the two databases rather than the alias.
20
21
Note
I use isql in the above examples as gstat -h seems to get confused about how many shadows there are on
a database. It reports zero when there are two, eventually it catches up and reports that there are two, then, if
you kill a shadow, it reports that there are now three!
The backup file will have the same owner and group as the Firebird database server - on Unix systems at least.
It is also possible to restore a remote database in this manner as well, and gbak allows this.
tux> # Restore the read-only reporting database on remote server tuxrep.
tux> gbak -replace -mode read_only -service tuxrep:service_mgr \
/backups/remote_backup.fbk employee
Note
The above example uses the handy Unix ability to split a long line over many shorter ones using a back slash
as the final character on the line.
As ever, you are advised to beware of replacing a database in case there are problems during the restore. The
example above recreates the existing database in read-only mode but this need not always be the case.
A remote backup can also be run on the database server itself! On Windows, this makes no difference, but on
Unix systems, this local-remote method of backups and restores reduces network traffic. The 'remote' server, in
this case, is not actually remote it is just the method of running the backup - connecting to the service manager
- that implies remoteness.
tux> # Backup the employee database on this server, but pseudo-remotely!
tux> gbak -backup -service tux:service_mgr employee /backups/remote_backup.fbk
22
the
parameter
separator
is
colon,
as
in
-service
Named pipes
When using named pipes, the parameter requires two leading back slashes and the separator is another back
slash, as in -service \\server_name\service_mgr.
When the above is executed, you will be prompted for a password for the remote firebird user on server tuxrep,
assuming that you don't have a proper SSH key-pair already set up and active. The command will replace the
local database according to the alias name emptest but you can, if required, supply full path names for the
databases. The following shows an example of the above being executed.
tux> # Clone a test database to a different server, without requiring a dump file.
tux> gbak -backup employee stdout | \
ssh firebird@tuxrep "gbak {...} -replace stdin emptest"
firebird@tuxrep's password:
As you can see, there's not much in the way of output, but you can connect remotely and check:
tux> isql {...} tuxrep:emptest
Database:
tuxrep:emptest
23
The next example, shows a remote database being backed up to a local one, in a similar manner.
tux> ssh firebird@tuxrep "gbak -backup {...} emptest stdout" | \
gbak -create stdin data/tuxrep_emptest.fdb
firebird@tuxrep's password:
tux> ls data
employee.fdb
tuxrep_emptest.fdb
You can see that a new tuxrep_emptest.fdb database has been created. Does it work? Checking with isql
shows that it does.
tux> isql data/tuxrep_emptest.fdb
Database:
data/tuxrep_emptest.fdb
SQL> quit;
The final example shows how to backup a remote database on one server, to a remote database on another.
tux> ssh firebird@tuxrep "gbak -backup {...} emptest stdout" | \
ssh firebird@tuxqa "gbak -create {...} stdin data/tuxrep_empqa.fdb"
firebird@tuxrep's password:
firebird@tuxqa's password
tux> ssh firebird@tuxqa "ls data"
employee.fdb
tuxrep_empqa.fdb
24
The following shows the use of the gzip utility on a Linux server to take and compress a backup of a running
database. The following is run as the root user due to the requirement to run gfix to shut down the database.
tux>
tux>
tux>
tux>
The restore process for this database would be the reverse of the above. Again, the following runs as root.
tux>
tux>
tux>
tux>
Gbak Caveats
The following is a brief list of gotchas and funnies that I have detected in my own use of gbak. Some of these
are mentioned above, others may not be. By collecting them all here in one place, you should be able to find
out what's happening if you have problems.
25
Silent Running?
The -y suppress_output switch is supposed to cause all output to be suppressed. Similar in fact to running
with -v[erify] not specified. However, all it seems to do is cause the output (according to the -v[erify]
switch setting) to be written to a file called suppress_output, however this only works once because the
next run of gbak with -y suppress_output will fail because the file, suppress_output, already exists.
It is possible that this problem was introduced at version 2 for Firebird, because both 2.0 and 2.1 versions actually
use the -y suppress switch rather then -y suppress_output. Using this (shorter) option does work as
intended and the output is indeed suppressed.
The above is quite useful in as much as it prevents you from overwriting previous backups that may be required.
The downside is that you now need to introduce a housekeeping system to tidy away old, unwanted backups
to prevent your backup area filling up.
27
Appendix A:
Document history
The exact file history is recorded in the manual module in our CVS tree; see http://sourceforge.net/cvs/?
group_id=9028 . The full URL of the CVS log for this file can be found at http://firebird.cvs.sourceforge.net/
viewvc/firebird/ manual/src/docs/firebirddocs/fbutil_gbak.xml?view=log
Revision History
1.0
10 October
2009
ND
1.1
20 October
2009
ND
1.2
24 November
2009
ND
1.3
24 June 2010
ND
1.4
09 August 2010 ND
1.5
31 March 2011 ND
1.6
11 October
2011
1.7
11 January 2013ND
Updated to document the use of the stdin and stdout file names in backups and restores, which allow backups to be written to or read from
standard input and standard output.
A section was added on the use of the above to clone databases without requiring an intermediate dump file. An additional section was also
added to show how, using the above in conjunction with SSH, backup
and/or restore operations could be carried out on databases where one
or both of the databases in question, are remote.
1.8
14 January 2013ND
Further updates to document the use of the stdin and stdout file names
in backups and restores. A section has been added to Gbak Caveats giving more in depth detail about these two special file names.
1.9
11 April 2013
ND
ND
28
1.10
1 May 2013
ND
1.11
1 May 2013
ND
A correction to the above change to the -use_[all_space] command line switch - it affects all subsequent pages as well as the ones
created during the restore.
29
Appendix B:
License notice
The contents of this Documentation are subject to the Public Documentation License Version 1.0 (the License); you may only use this Documentation if you comply with the terms of this License. Copies of the License are available at http://www.firebirdsql.org/pdfmanual/pdl.pdf (PDF) and http://www.firebirdsql.org/manual/pdl.html (HTML).
The Original Documentation is titled Firebird Backup & Restore Utility.
The Initial Writer of the Original Documentation is: Norman Dunbar.
Copyright (C) 2009-2013. All Rights Reserved. Initial Writer contact: NormanDunbar at users dot sourceforge
dot net.
30