backup 2.3 KB

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