backup 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. #!/bin/bash
  2. echo "backup script is not implemented"
  3. exit 0
  4. #=================================================
  5. # GENERIC START
  6. #=================================================
  7. # IMPORT GENERIC HELPERS
  8. #=================================================
  9. if [ ! -e _common.sh ]; then
  10. # Get the _common.sh file if it's not in the current directory
  11. cp ../settings/scripts/_common.sh ./_common.sh
  12. chmod a+rx _common.sh
  13. fi
  14. source _common.sh
  15. source /usr/share/yunohost/helpers
  16. #=================================================
  17. # MANAGE SCRIPT FAILURE
  18. #=================================================
  19. # Exit if an error occurs during the execution of the script
  20. ynh_abort_if_errors
  21. #=================================================
  22. # LOAD SETTINGS
  23. #=================================================
  24. app=$YNH_APP_INSTANCE_NAME
  25. final_path=$(ynh_app_setting_get $app final_path)
  26. domain=$(ynh_app_setting_get $app domain)
  27. db_name=$(ynh_app_setting_get $app db_name)
  28. #=================================================
  29. # STANDARD BACKUP STEPS
  30. #=================================================
  31. # BACKUP THE APP MAIN DIR
  32. #=================================================
  33. # LOAD SETTINGS
  34. #=================================================
  35. app=$YNH_APP_INSTANCE_NAME
  36. final_path=$(ynh_app_setting_get $app final_path)
  37. domain=$(ynh_app_setting_get $app domain)
  38. #=================================================
  39. # STANDARD BACKUP STEPS
  40. #=================================================
  41. # BACKUP THE APP MAIN DIR
  42. #=================================================
  43. ynh_backup "$final_path"
  44. #=================================================
  45. # BACKUP THE NGINX CONFIGURATION
  46. #=================================================
  47. ynh_backup "/etc/nginx/conf.d/$domain.d/${app}.conf"
  48. #=================================================
  49. # BACKUP THE PHP-FPM CONFIGURATION
  50. #=================================================
  51. ynh_backup "/etc/php5/fpm/pool.d/$app.conf"
  52. #=================================================
  53. # SPECIFIC BACKUP
  54. #=================================================
  55. # BACKUP SYSTEMD
  56. #=================================================
  57. ynh_backup "/etc/systemd/system/ynh-vpnclient.service"
  58. ynh_backup "/etc/systemd/system/ynh-vpnclient-checker.service"
  59. ynh_backup "/etc/systemd/system/ynh-vpnclient-checker.timer"
  60. ynh_backup "/etc/cron.d/$app"