template-db2bak.in 540 B

123456789101112131415161718192021222324
  1. #!/bin/sh
  2. prefix="{{DS-ROOT}}"
  3. if [ "$prefix" = "/" ] ; then
  4. prefix=""
  5. fi
  6. LD_LIBRARY_PATH=$prefix/{{SERVER-DIR}}:$prefix@nss_libdir@:$prefix@libdir@:$prefix@pcre_libdir@
  7. if [ -n "$prefix" ] ; then
  8. LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:@nss_libdir@"
  9. fi
  10. export LD_LIBRARY_PATH
  11. SHLIB_PATH=$LD_LIBRARY_PATH
  12. export SHLIB_PATH
  13. cd {{SERVERBIN-DIR}}
  14. if [ "$#" -eq 1 ]
  15. then
  16. bak_dir=$1
  17. else
  18. bak_dir={{BAK-DIR}}/{{SERV-ID}}-`date +%Y_%m_%d_%H_%M_%S`
  19. fi
  20. echo "Back up directory: $bak_dir"
  21. ./ns-slapd db2archive -D {{CONFIG-DIR}} -a $bak_dir