zammad_restore.sh 700 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/usr/bin/env bash
  2. #
  3. # zammad restore script
  4. #
  5. PATH=/sbin:/bin:/usr/sbin:/usr/bin:
  6. BACKUP_SCRIPT_PATH="$(dirname $(realpath $0))"
  7. if [ -f "${BACKUP_SCRIPT_PATH}/config" ]; then
  8. # import config
  9. . ${BACKUP_SCRIPT_PATH}/config
  10. else
  11. echo -e "\n The 'config' file is missing!"
  12. echo -e " Please copy ${BACKUP_SCRIPT_PATH}/config.dist to ${BACKUP_SCRIPT_PATH}/config before running $0!\n"
  13. exit 1
  14. fi
  15. # import functions
  16. . ${BACKUP_SCRIPT_PATH}/functions
  17. # exec restore
  18. start_restore_message
  19. get_zammad_dir
  20. restore_warning "${1}"
  21. check_database_config_exists
  22. get_restore_dates
  23. choose_restore_date "${1}"
  24. detect_initcmd
  25. stop_zammad
  26. restore_zammad
  27. start_zammad
  28. finished_restore_message