backup 2.3 KB

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