Skip to content
Snippets Groups Projects

LDAP Backup Script

  • Clone with SSH
  • Clone with HTTPS
  • Embed
  • Share
    The snippet can be accessed without any authentication.
    Authored by Zachary Seguin
    backup-ldap 324 B
    #!/bin/bash
     
    BACKUP_PATH=/backup/ldap/$(date +%y-%m-%d-%H-%M)
    SLAPCAT=/usr/sbin/slapcat
     
    mkdir ${BACKUP_PATH}
    nice ${SLAPCAT} -n 0 > ${BACKUP_PATH}/config.ldif
    nice ${SLAPCAT} -n 1 > ${BACKUP_PATH}/zacharyseguin.ca.ldif
     
    tar -zcPf ${BACKUP_PATH}.tar.gz ${BACKUP_PATH}
    chmod 640 ${BACKUP_PATH}.tar.gz
    rm -rf ${BACKUP_PATH}
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please register or to comment