乡下人产国偷v产偷v自拍,国产午夜片在线观看,婷婷成人亚洲综合国产麻豆,久久综合给合久久狠狠狠9

  • <output id="e9wm2"></output>
    <s id="e9wm2"><nobr id="e9wm2"><ins id="e9wm2"></ins></nobr></s>

    • 分享

      LDAP 備份還原

       ala咪s 2019-07-17

      LDAP 備份還原

      備份

      OpenLDAP 中數(shù)據(jù)備份一般分為三種方式,一種通過(guò) slapcat 指令進(jìn)行備份,一種通過(guò) phpLDAPadmin 控制臺(tái)進(jìn)行備份,另一種通過(guò)數(shù)據(jù)目錄來(lái)實(shí)現(xiàn)備份。本次只介紹最簡(jiǎn)單直接的辦法–使用 slapcat

      slapcat

      slapcat幫助文檔

      備份腳本

      #!/usr/bin/env bash

      LDAPBK=ldap-$( date +%Y%m%d-%H ).ldif

      BACKUPDIR=/data/ldap_backups

      BACKUP_EXEC=`which slapcat`

      PACKAGE=`which gzip`

      checkdir(){

      if [ ! -d "$BACKUPDIR" ]; then

        mkdir -p ${BACKUPDIR}

      fi

      }

      backuping(){

      echo "Backup Ldap Start...."

      ${BACKUP_EXEC} -v -l ${BACKUPDIR}/${LDAPBK}

      ${PACKAGE} -9 $BACKUPDIR/$LDAPBK

      }

      checkdir

      backuping

      1

      2


      定時(shí)備份

      具體時(shí)間自己把控

      crontab -e

      00 */2 * * * /path/ldap_backup.sh

      1

      2

      還原

      模擬數(shù)據(jù)丟失

      # 獲取所有用戶(hù)配置條目

      ldapsearch -x -Z -LLL -H ldap://172.16.10.220 -b 'ou=People,dc=laoshiren,dc=com' | wc -l

      106

      # 清空所有所有條目

      ldapdelete -x -D "cn=manager,dc=laoshiren,dc=com" -w FCzxpJWCccuB -r "dc=laoshiren,dc=com"

      # 確認(rèn)條目

      ldapsearch -x -Z -LLL -H ldap://172.16.10.220 -b 'ou=People,dc=laoshiren,dc=com' | wc -l

      0

      1


      還原數(shù)據(jù)

      systemctl stop slapd && systemctl status slapd

      # 清空原openldap數(shù)據(jù)

      rm -fr /var/lib/ldap/*

      /usr/sbin/slapadd -l /data/ldap_backups/ldap-20190109-21.ldif

      # 輸出

      5c36b84d The first database does not allow slapadd; using the first available one (2)

      5c36b84d hdb_db_open: warning - no DB_CONFIG file found in directory /var/lib/ldap: (2).

      Expect poor performance for suffix "dc=laoshiren,dc=com".

      _#################### 100.00% eta   none elapsed            none fast!

      Closing DB...

      # 拷貝數(shù)據(jù)配置文件

      cp /usr/share/openldap-servers/DB_CONFIG.example /var/lib/ldap/DB_CONFIG

      # 賦權(quán)

      chown ldap:ldap -R /var/lib/ldap/

      # 啟動(dòng) slapd

      systemctl start slapd && systemctl status slapd

      1


      驗(yàn)證數(shù)據(jù)

      # 驗(yàn)證條目

      ldapsearch -x -Z -LLL -H ldap://172.16.10.220 -b 'ou=People,dc=laoshiren,dc=com' | wc -l

      106

      # 驗(yàn)證登錄

      ssh -i ~/.ssh/id_rsa clin@172.16.10.10

      Last login: Wed Jan  9 21:43:07 2019 from 172.16.10.1

      -sh-4.2$

      1

      2

      3

      4

      5

      6

      7

      恢復(fù)完成


      原文:https://blog.csdn.net/u011607971/article/details/86221860 

        本站是提供個(gè)人知識(shí)管理的網(wǎng)絡(luò)存儲(chǔ)空間,所有內(nèi)容均由用戶(hù)發(fā)布,不代表本站觀(guān)點(diǎn)。請(qǐng)注意甄別內(nèi)容中的聯(lián)系方式、誘導(dǎo)購(gòu)買(mǎi)等信息,謹(jǐn)防詐騙。如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)點(diǎn)擊一鍵舉報(bào)。
        轉(zhuǎn)藏 分享 獻(xiàn)花(0

        0條評(píng)論

        發(fā)表

        請(qǐng)遵守用戶(hù) 評(píng)論公約

        類(lèi)似文章 更多