Used: openldap-servers-2.4.23-34.el6_5.1.x86_64
Task: create script for crontab
to create scheduled database full backup.
1) slapcat
- create file in in the default format, Berkeley DB.
2) slapcat
can be done while slapd
running (if bdb/hdb
database used).
3) To restore file after slapcat
- must be used slapadd
(not ldapadd
).
4) slapcat/add
doesn't require password.
5) slapadd
can be done only when slapd
stopped.
Example:
$ slapcat -f /etc/openldap/slapd.conf -b "dc=db_1" -l db_1_backup.ldif
$ slapadd -l db_1_backup.ldif
Instead of slapcat/add
- let's took a look at ldapsearch/add
:
1) ldapsearch
- creates file with almost same information as slapcat
;
2) ldapadd
- can use file from ldapsearch
, doesn't require slapd
to be stopped;
3) ldapadd/search
- requires password.
Example:
$ ldapsearch -D "cn=root,dc=db_1" -W -b "dc=db_1" "dc=db_1" -LLL > db_1_backup2.ldif
$ ldapadd -x -D "cn=root,dc=db_1" -W -f db_1_backup2.ldif
So - question is:
1) Am I missing anything in this tools description?
2) What else is difference between ldapadd/slapadd
and ladpsearch/slapcat
?