[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: backup / restore over network



On Wed, Dec 19, 2001 at 06:15:32PM -0500, Kevin McCarthy wrote:
% I need to be able to take a snapshot of an LDAP tree using LDAP queries
% (can not use slapcat, .dbb files, etc.). I must be able to pull the entire
% contents of a directory to a my local machine over the network, since I
% have no shell access to the remote server.
[snip]
% I am thinking the best way to get around this is to write a recursive
% function that starts at the rootdse and crawls step by step towards leaf
% nodes. No problem, except that I have to use shell scripts or compiled
% C/C++ to do this (no Perl, Tcl, Python, etc.) Writing recursive ksh
% scripts is not fun, and calling ldapsearch one time per parent is really
% heavy.

Are you going to need to "restore" this backup remotely, too? If not, (IIRC)
slapadd doesn't care about order, so you can ldapsearch on the root DSE and
pipe the output to slapadd to restore.

Or, from man ldapsearch:

       -S attribute
              Sort  the  entries returned based on attribute. The
              default  is  not  to  sort  entries  returned.   If
              attribute is a zero-length string (""), the entries
              are sorted by the components of their  Distingished
              Name.  See ldap_sort(3) for more details. Note that
              ldapsearch  normally  prints  out  entries  as   it
              receives  them.  The  use  of the -S option defeats
              this behavior, causing all entries to be retrieved,
              then sorted, then printed.

Though if your tree is big, ldapsearch will probably suck huge amounts of
RAM.

john
-- 
John Morrissey          _o            /\         ----  __o
jwm@horde.net        _-< \_          /  \       ----  <  \,
www.horde.net/    __(_)/_(_)________/    \_______(_) /_(_)__