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

Re: Re: ldapdelete: Use wild card to delete multiple enetries



Thanks for your answer.
So I take it that we can't give wild card/regular _expression_ in ldapdelete.

I have just installed an OpenLDAP with LMDB only [ without bdb/hdb].
./configure --prefix=/my/home/directory/parveen/OpenLDAP_LMDB  --exec-prefix=/my/home/directory/parveen/OpenLDAP_LMDB --enable-bdb=no --enable-hdb=no

So I was adding and deleting entries and it was taking time.
For addition, I switch from ldapadd to slapadd [stoping slapd for a while].
For deletion, I was thinking of some wild card like things to see if timing can be improved.

I was adding some 100K entries and deleting them, it was taking time, so I thought it could be faster if we give command in one go and then ldapdelete just receives the output and send to STDOUT/STDERR.


To Others,
Is there any plan for adding wild cards or its in my fantasy only?
The GURU has well decided not to provide such things as ldapdelete is destructive and a little misunderstanding in handling wildcards/regular _expression_ can delete the DB.

Thanks anyways!!

----------------

Hi,

you cannot use wildcards in deletes as per my understanding. You can, however, use wildcards in search filters.
If you are on a Unix-like system, you can feed the output of a search with a bit of transformation into ldapmodify.
You may want to try something like this (I ran this on Linux):

ldapmodify -f <(ldapsearch -b "dc=ALCATEL,dc=FR" "(cn=Parveen30*)" | grep dn: | sed 's/$/\nchangetype:delete\n'/)
Regards,

tamás

On Wed, Jun 8, 2016 at 5:54 PM, Parveen Verma <parveen.subs@gmail.com> wrote:
Hello All,

Is there a Way to delete multiple LDAP entries by using some wildcards or regular _expression_.
Like I have below entries.
dn: cn=Parveen20,dc=ALCATEL,dc=FR
dn: cn=Parveen200,dc=ALCATEL,dc=FR
dn: cn=Parveen201,dc=ALCATEL,dc=FR
dn: cn=Parveen202,dc=ALCATEL,dc=FR
dn: cn=Parveen203,dc=ALCATEL,dc=FR
dn: cn=Parveen204,dc=ALCATEL,dc=FR
dn: cn=Parveen205,dc=ALCATEL,dc=FR
dn: cn=Parveen206,dc=ALCATEL,dc=FR
dn: cn=Parveen207,dc=ALCATEL,dc=FR
dn: cn=Parveen208,dc=ALCATEL,dc=FR
dn: cn=Parveen209,dc=ALCATEL,dc=FR
dn: cn=Parveen30,dc=ALCATEL,dc=FR
dn: cn=Parveen300,dc=ALCATEL,dc=FR
dn: cn=Parveen301,dc=ALCATEL,dc=FR
dn: cn=Parveen302,dc=ALCATEL,dc=FR
dn: cn=Parveen303,dc=ALCATEL,dc=FR
dn: cn=Parveen304,dc=ALCATEL,dc=FR
dn: cn=Parveen305,dc=ALCATEL,dc=FR
dn: cn=Parveen306,dc=ALCATEL,dc=FR
dn: cn=Parveen307,dc=ALCATEL,dc=FR
dn: cn=Parveen308,dc=ALCATEL,dc=FR
dn: cn=Parveen309,dc=ALCATEL,dc=FR


I want to delete entries with 301,302,303....
So how can I give this, except putting all these in a LDIF file.

or how can below work

cn=Parveen30*,dc=ALCATEL,dc=FR