LDAP Backups
Closed this issue · 2 comments
vandivia commented
Hi! Is there any way to make LDAP Backups from scripts?
ApacheDS documentation sais:
$ ldapsearch -D "uid=admin,ou=system" -w secret -p 10389 -h localhost -b "dc=example,dc=com" -s sub "(ObjectClass=*)" * + > backup.ldif
But ldapsearch command is not found inside the container.
Thanks!!
sbesson commented
Hi @vandivia,
I retested the ldapsearch
command you pasted using the default tree created at container startup. With it, I was able to write the output of ldapsearch
to a local file:
[sbesson@idr2-slot3 ~]$ docker run --rm --name issue_90 -d openmicroscopy/apacheds
d8691a4fec481fc23febfdc38fe94f76ab44a5c31b19339c9a20a6ff7a49daf2
[sbesson@idr2-slot3 ~]$ docker exec -it issue_90 ldapsearch -V
ldapsearch: @(#) $OpenLDAP: ldapsearch (Ubuntu) (Oct 23 2018 12:47:19) $
buildd@lgw01-amd64-005:/build/openldap-rkQ3K8/openldap-2.4.42+dfsg/debian/build/clients/tools
(LDAP library: OpenLDAP 20442)
ldap_sasl_interactive_bind_s: Can't contact LDAP server (-1)
[sbesson@idr2-slot3 ~]$ docker exec -it issue_90 ldapsearch -v -h localhost -p 10389 -w secret -x -D uid=admin,ou=system -b dc=openmicroscopy,dc=org * + > backup.ldif
[sbesson@idr2-slot3 ~]$ cat backup.ldif
ldap_initialize( ldap://localhost:10389 )
filter: (objectclass=*)
requesting: aspera-client-docker bio-formats-octave-docker config devspace idr0066 octave-docker omero-server-docker omero-web-docker out +
# extended LDIF
#
# LDAPv3
# base <dc=openmicroscopy,dc=org> with scope subtree
# filter: (objectclass=*)
# requesting: aspera-client-docker bio-formats-octave-docker config devspace idr0066 octave-docker omero-server-docker omero-web-docker out +
#
# openmicroscopy.org
dn: dc=openmicroscopy,dc=org
entryCSN: 20190906100237.046000Z#000000#000#000000
nbSubordinates: 0
nbChildren: 0
subschemaSubentry: cn=schema
entryDN: dc=openmicroscopy,dc=org
entryUUID: 0f2e8b2f-dbe1-48ba-88fc-c61ef7849194
contextCSN: 20190906100237.046000Z#000000#000#000000
entryParentId: 00000000-0000-0000-0000-000000000000
# search result
search: 2
result: 0 Success
# numResponses: 2
# numEntries: 1
[sbesson@idr2-slot3 ~]$ docker stop issue_90
issue_90
Can you give us more details about the way you execute the command and the error that it gives?
manics commented
Closing, no response