ldap-git-backup icon indicating copy to clipboard operation
ldap-git-backup copied to clipboard

Fix bug #4

Open rda0 opened this issue 6 years ago • 4 comments

Hi Elmar

I would like to make some changes to ldap-git-backup suitable for our new setup at the ISG D-PHYS as explained below. I also plan to add another option to be able to exclude some attributes from the backup. I am curious about your feedback.

If ldap-git-backup is used to backup the OpenLDAP configuration stored in cn=config, the order of entries is critical for a restore scenario. Therefore adding the possibility to have the entries' file names prefixed with a zero-padded number will allow to concatenate the files using their filename in the correct order. This may also be useful if one needs to restore only some parts of the database using ldapadd to a running slapd instance. It may also be useful to have the DN of the entry in the filename to concatenate only parts of the database backup.

rda0 avatar Dec 20 '17 21:12 rda0

Hi Sven,

thanks for the suggestions and the patch. We'll have a look at it.

It's a little bit of a unlucky timing as I just released 1.0.8 yesterday despite not much (actually no code, just documentation, packaging and test suite) changed. (But that's not your fault, just bad luck.)

xtaran avatar Dec 21 '17 00:12 xtaran

Hi Axel

That is no problem at all, I just wanted to get some feedback. And maybe also know what the intentions were to use hashes as filenames. I am not sure anymore if it is wise at all to use DNs in the filenames, because of the maximum file size limitation. But I think for our database it will never be a problem most probably, we are at a max DN length of 131 at the moment.

It certainly needs some testing...

rda0 avatar Dec 21 '17 09:12 rda0

Hi Axel

I added a few more commits. Have a look at 55d5d7e which probably fixes the issue (error 7: very big file list to add to git). It now does multiple git add operations when a predefined limit arg_max is exceeded.

rda0 avatar Dec 21 '17 17:12 rda0

I reverted all the changes which add new features and moved them to separate branches. This only leaves the changes for the fix of #4 in the master branch.

I will not make new pull requests for the new features at the moment:

  • filter
  • sort

The reason for this: I changed my mind and I now think it may be better to create a separate script for the sorting of the entries, to not bloat the backup code. In addition the new features could add other possible problems:

  • not allowed characters in filenames, which may appear in DNs (/)
  • max. allowed filename length

The filtering may be achieved by using an ldif-cmd, which pipes the LDIF to grep.

Please let me know if I should still make a pull request for these branches.

rda0 avatar Jan 04 '18 15:01 rda0