Redbrick User management tool
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
606 B

  1. #! /bin/sh
  2. #
  3. # Simple way of dumping live ldap database and rrs.log file and copying them
  4. # somewhere else.
  5. #
  6. while true; do
  7. # Can't use slapcat safely as the ldap database is read-write and in use.
  8. ldapsearch -x -w "LDAP-SECRET" -D cn=root,ou=ldap,o=redbrick -h localhost > shrapnel.ldif.bak
  9. # We're paranoid.
  10. sync; sync; sync
  11. # Again with the paranoia.
  12. cp rrs.log rrs.log.bak
  13. # Assumes SSH agent is running.
  14. scp shrapnel.ldif.bak rrs.log.bak carbon:
  15. # More healthy paranoia.
  16. ssh carbon 'cp shrapnel.ldif.bak shrapnel.ldif; cp rrs.log.bak rrs.log'
  17. # Wait 5 minutes.
  18. sleep 300
  19. done