LDAP-GIT-BACKUP(1) | User Commands | LDAP-GIT-BACKUP(1) |
ldap-git-backup - check in LDIF from an LDAP server into a GIT repository
ldap-git-backup [options]
ldap-git-backup --help
ldap-git-backup takes an LDIF dump of an LDAP server and updates a GIT repository that serves as a versioned backup.
ldap-git-backup splits the LDIF data into separate entries. It constructs unique but stable file names using a combination of the creation time stamp for ordering and the DN as the unique key for an entry.
If you have access to an LDAP server over the network you can use ldapsearch as your "--ldif-cmd". Example:
--ldif-cmd 'ldapsearch -u -x -o ldif-wrap=no \ -H ldaps://ldap.example.org -b dc=example,dc=org'
If you need to log in to a certain server first you would use something along the lines of
--ldif-cmd 'ssh host.example.org ldapsearch -u -x -o ldif-wrap=no \ -H ldaps://ldap.example.org -b dc=example,dc=org'
You can make this as complicated as you like as long as it fits into a one line command. If you need more you may want to create a script for the purpose.
Example:
--commit-msg "Import $(date --rfc-3339=seconds)"
Elmar S. Heeb <elmar@heebs.ch>
2021-01-06 | 1.0.8 |