2017-04-09 11:05:39 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Exit on command errors and treat unset variables as an error
|
|
|
|
set -eu
|
|
|
|
|
|
|
|
# See comments in install script
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
|
|
|
|
# Source YunoHost helpers
|
|
|
|
. /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
# Backup sources & data
|
|
|
|
ynh_backup "/opt/$app" "sources"
|
|
|
|
|
|
|
|
# Copy NGINX configuration
|
|
|
|
domain=$(ynh_app_setting_get "$app" domain)
|
|
|
|
ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf" "nginx.conf"
|
|
|
|
|
|
|
|
# Copy Gunicorn pool configuration
|
|
|
|
ynh_backup "/etc/systemd/system/$app.service" "gunicorn.service"
|
2018-12-20 23:05:20 +01:00
|
|
|
|
|
|
|
# Backup database
|
|
|
|
ynh_psql_dump_db "$app" > ${YNH_CWD}/dump.sql
|