HP-UX Directory Server Administrator Guide HP-UX Directory Server Version 8.1 (5900-3098, May 2013)

4.3.1.2 Backing up all databases from the command line
Databases can be backed up from the command line using the db2bak command line script. This
script works when the server is running or when the server is stopped.
Configuration information cannot be backed up using this backup method. For information on
backing up the configuration information, see “Backing up all databases from the command
line” (page 161).
To back up the directory from the command line using the db2bak script:
1. Run the db2bak command line script.
/opt/dirsrv/slapd-instance_name/db2bak \
/var/opt/dirsrv/slapd-instance_name/bak/instance_name-2009_04_30_16_27_56
For more information about using the db2bak script, see the HP-UX Directory Server configuration,
command, and file reference.
The backup directory where the server saves the backed up databases can be specified with the
script. If a directory is not specified, the backup file is stored in
/var/opt/dirsrv/slapd-instance_name/bak. By default, the backup directory is named
with the Directory Server instance name and the date of the backup
(instance_name-YYYY_MM_DD_hh_mm_ss).
4.3.1.3 Backing up the database through the cn=tasks entry
The cn=tasks, cn=config entry in the Directory Server configuration is a container entry for
temporary entries that the server uses to manage tasks. Several common directory tasks have
container entries under cn=tasks, cn=config. Temporary task entries can be created under
cn=backup, cn=tasks, cn=config to initiate a backup operation.
The backup task entry requires three attributes:
A unique name (cn).
The directory to write the backup file to (nsArchiveDir). The backup file is named with the
Directory Server instance name and the date of the backup
(instance_name-YYYY_MM_DD_hhmmss).
The type of database (nsDatabaseType); the only option is ldbm database.
The entry is simply added using ldamodify, as described in Adding and modifying entries using
ldapmodify” (page 112). For example:
ldapmodify -a -D "cn=directory manager" -w secret -p 389 -h server.example.com
dn: cn=example backup, cn=backup, cn=tasks, cn=config
objectClass: top
objectClass: extensibleObject
cn: example backup
nsArchiveDir: /home/backups/
nsDatabaseType: ldbm database
As soon as the task is completed, the entry is removed from the directory configuration.
The HP-UX Directory Server configuration, command, and file reference has more information on
the available attributes for running tasks to back up databases under the cn=tasks entries.
4.3.2 Backing up the dse.ldif configuration file
Directory Server automatically backs up the dse.ldif configuration file. When the Directory
Server is started, the directory creates a backup of the dse.ldif file automatically in a file named
dse.ldif.startOK in the /etc/opt/dirsrv/slapd-instance_name directory.
When the dse.ldif file is modified, the file is first backed up to a file called dse.ldif.bak
in the /etc/opt/dirsrv/slapd-instance_name directory before the directory writes the
modifications to the dse.ldif file.
4.3 Backing up and restoring data 161