LDAP-GIT-BACKUP(1)

πŸ“¦
version 1.0.8 Β· 2 versions
, in debian bookworm, debian trixie, ubuntu jammy, ubuntu noble

✨ LDAP-GIT-BACKUP ✨

okay bestie, pull up a chair πŸ’– this is the manual page for ldap-git-backup, a User Commands classic, and honestly? it's giving "your LDAP directory but make it version controlled" πŸ‘‘


🌸 NAME 🌸

ldap-git-backup β€” check in LDIF from an LDAP server into a GIT repository

like. it takes your LDIF and commits it. that's the whole vibe. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

ldap-git-backup [options]

ldap-git-backup --help

πŸ’œ DESCRIPTION πŸ’œ

okay so here's the tea β˜• ldap-git-backup takes an LDIF dump of an LDAP server and updates a GIT repository that serves as a versioned backup. it's a backup but make it aesthetic β€” every state of your directory lives in git history. iconic behavior, no cap.

and the way it works?? ldap-git-backup splits the LDIF data into separate entries. then 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. so like, deterministic names, sorted by time, keyed by DN. chef's kiss πŸ’…


✨ OPTIONS ✨

  • --ldif-cmd <dump_ldif_command> β€” specify a command that creates a complete LDIF dump of the LDAP directory, suitable for a backup. it should contain all entries necessary to restore the LDAP database. by default /usr/sbin/safe-ldif is taken, which calls /usr/sbin/slapcat from OpenLDAP. 🫢

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'

and if you need to log in to a certain server first, you'd 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. (get your main character energy on, bestie 🧚)

  • --backup-dir <backup_directory> β€” specify the directory where the GIT repository for the versioned backup is held. default: /var/backups/ldap πŸ“
  • --commit-msg <commit_string> β€” specify a custom commit message. default: ldap-git-backup

example:

--commit-msg "Import $(date --rfc-3339=seconds)"
  • --commit-date <date_string> / --commit-date <file> β€” specify a custom commit date. if a file is given, its modification time is used. ⭐
  • --no-gc β€” do not perform a garbage collection (git gc) after checking in the new backup. by default gc is done so as to keep the size of the backup down. you may want to skip gc for the occasional backup run but leave it on for the scheduled backups. lowkey a good tip, highkey true πŸ’€
  • --help β€” prints this page. πŸ“–
ngl bestie, that's literally every option. we ate. πŸ”₯

πŸ‘‘ AUTHOR πŸ‘‘

Elmar S. Heeb <elmar@heebs.ch>


and that's the whole page, fr fr πŸ’– this was ldap-git-backup version 1.0.8, dated 2021-01-06 β€” go forth and version your directory, you absolute legend πŸŒˆβœ¨πŸ’…

πŸ“¦ where this page comes from