Skip to content

Instantly share code, notes, and snippets.

@j1n6
Last active December 25, 2018 08:55
Show Gist options
  • Select an option

  • Save j1n6/ba5a1bbe977189355fa1 to your computer and use it in GitHub Desktop.

Select an option

Save j1n6/ba5a1bbe977189355fa1 to your computer and use it in GitHub Desktop.
#!/bin/sh
slapcat -v -l ldap.ldif
# The restore will go through replacing current database from a one we have in ldif backup.
#!/bin/sh
# Stop slapd daemon
/etc/init.d/slapd stop
# Remove current database
rm -rf /var/lib/ldap/*
# Import directory tree from backup
slapadd -l backup.ldif
# Fix permissions
chown -R openldap:openldap /var/lib/ldap/*
# Start slapd daemon
/etc/init.d/slapd start
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment