backup 835 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/bash
  2. # Exit on command errors and treat unset variables as an error
  3. set -eu
  4. # See comments in install script
  5. app=$YNH_APP_INSTANCE_NAME
  6. # Source YunoHost helpers
  7. . /usr/share/yunohost/helpers
  8. # Backup sources & data
  9. # Note: the last argument is where to save this path, see the restore script.
  10. ynh_backup "/var/www/${app}" "sources"
  11. # If a MySQL database is used:
  12. #
  13. # # Dump the database
  14. # dbname=$app
  15. # dbuser=$app
  16. # dbpass=$(ynh_app_setting_get "$app" mysqlpwd)
  17. # mysqldump -u "$dbuser" -p"$dbpass" --no-create-db "$dbname" > ./dump.sql
  18. # Copy NGINX configuration
  19. domain=$(ynh_app_setting_get "$app" domain)
  20. ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf" "nginx.conf"
  21. # If a dedicated php-fpm process is used:
  22. #
  23. # # Copy PHP-FPM pool configuration
  24. # ynh_backup "/etc/php5/fpm/pool.d/${app}.conf" "php-fpm.conf"