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

Re: Cleaning slapcat(1) LDIF output

> Hi all,
> According slapcat(1) man:

There is no slapcat(1) man page.  You probably mean slapcat(8).

> "The output of slapcat is intended to be used as input to slapadd(8).
> The output of slapcat cannot generally be used as input to ldapadd(1) or
> other LDAP clients without first editing the output.  This editing would
> normally include reordering the records into superior first order and
> removing no-user-modification operational attributes."
> So, I've done:
> # making normal LDIF using slapcat(1)
> $ slapcat -l test_backup.ldif
> # cleaning the LDIF and dump the results in another file
> $ egrep -ve
> '^(entryUUID|creatorsName|structuralObjectClass|createTimestamp|entryCSN|modifiersName|modifyTimestamp):
> '  \ test_backup.ldif > test_backup_cleaned.ldif

> #viewing the differences
> $ diff -y test_backup.ldif test_backup_cleaned.ldif | less
> ¿Is it a correct way to "clean" the initial LDIF you can get with
> slapcat(1)?

Assuming there are no other operational attributes in your database, yes
with respect to eliminating NO-USER-MODIFICATION attrs.  There's still no
guarantee entries are sorted in superior-first order.

> And another minor question
> ¿Can I use the slapcat(1) tool on the fly? man pages say nothing about it.

According to slapcat(8):

   For some backend types, your slapd(8) should not be running (at  least,
   not  in  read-write mode) when you do this to ensure consistency of the
   database. It is always safe  to  run  slapcat  with  the  slapd-bdb(5),
   slapd-hdb(5), and slapd-null(5) backends.

so to answer one needs to know what backend you're referring to.