#include <db_cxx.h> int DbEnv::dbbackup(const char *dbfile, const char *target, u_int32_t flags);
The DbEnv::dbbackup()
method performs a hot
backup of a single database file contained within the environment.
To back up an entire environment, use the DbEnv::backup() method.
This method's default behavior can be changed by setting backup callbacks. See DbEnv::set_backup_callbacks() for more information. Additional tuning parameters can also be set using the DbEnv::set_backup_config() method.
The DbEnv::dbbackup()
method may only be
called after the environment handle has been opened.
The DbEnv::dbbackup()
method either returns a non-zero error value or throws an
exception that encapsulates a non-zero error value on
failure, and returns 0 on success.
Identifies the directory in which the back up will be
placed. This target must exist; otherwise this method
exits with an ENOENT
error return.
Note that if the backup callbacks are set, then the value
specified to this parameter is passed on to the
open_func()
callback. If this
parameter is NULL, then the target must be specified
directly to the open_func()
callback.
The DbEnv::dbbackup()
method may fail and throw a DbException
exception, encapsulating one of the following non-zero errors, or return one
of the following non-zero errors:
DB_EXCL
was specified for the
flags
parameter, and an existing target
file was discovered when attempting to back up a source
file.