FBIRD_BACKUP
Purpose
Use fbird_backup to initiate a backup task on the
server system through the FB Services Manager.
Syntax
<backup>
::= fbird_backup(svc_hndl, src_db, dest_file [,
options [, verbose]])
Element
|
Type
|
Description
|
svc_hndl
|
resource
|
A valid service handle
|
src_db
|
string
|
Alias / path of DB to back up
|
dest_file
|
string
|
Path on server of backup file
|
options
|
integer
|
Backup options (see below)
|
verbose
|
bool
|
Verbose flag
|
<return>
|
mixed
|
False on failure; True or string for success
|
Semantics
Use this function to request the Services Manager
to perform a backup operation. This is a programmatic method to
invoke the gbak tool.
Paths of backup files are relative to the server.
Since the Services Manager executes backup and restore tasks on the
server host, the Services Manager reads and writes backup files on
the server host.
The following table lists the options that can be
specified for this backup operation:
Flag
|
Meaning
|
IBASE_BKP_IGNORE_CHECKSUMS
|
Ignore checksums during backup; corresponds to
“gbak -ignore”
|
IBASE_BKP_IGNORE_LIMBO
|
Ignore limbo transactions during backup;
corresponds to “gbak -limbo”
|
IBASE_BKP_METADATA_ONLY
|
Output backup file for metadata only with
empty tables; corresponds to “gbak -metadata”
|
IBASE_BKP_NO_GARBAGE_COLLECT
|
Suppress normal garbage collection during
backup; improves performance on some databases; corresponds to
“gbak -garbage_collect”
|
IBASE_BKP_OLD_DESCRIPTIONS
|
Output metadata in pre-IB4.0 format;
corresponds to “gbak -old_descriptions”
|
IBASE_BKP_NON_TRANSPORTABLE
|
Output backup file format with non-XDR data
format; slightly improves space and performance; corresponds to
“gbak -nt”
|
IBASE_BKP_CONVERT
|
Convert external table data to internal
tables; corresponds to “gbak -convert”
|
If the verbose flag is
specified, the Services Manager prepares output to return as a
string. This output corresponds to “gbak -verbose”.
The return value is
True for a succesful initiation of the backup process or a string in
case verbose is specified. The return value is False for a failed
initiation.
Example
The below example initiates a backup of 'mydb' on
the local machine, and reports back on the backup process steps:
$svc_hndl = fbird_service_attach
('localhost', 'username', 'password'); echo
fbird_backup($svc_hndl, 'mydb.fdb',
'c:\bckup\mydb.fbk', 0,
true); ibase_service_detach ($resource_service_handle);
See also
fbird_service_attach,
fbird_restore
|