2016-05-07 18:21:06 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-05-01 15:47:20 +02:00
|
|
|
#=================================================
|
|
|
|
# GENERIC STARTING
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
2016-05-07 18:21:06 +02:00
|
|
|
|
2019-03-03 20:32:26 +01:00
|
|
|
# source ../settings/scripts/_common.sh
|
2017-05-01 15:47:20 +02:00
|
|
|
source /usr/share/yunohost/helpers
|
2016-05-07 18:21:06 +02:00
|
|
|
|
2018-05-28 00:30:42 +02:00
|
|
|
#=================================================
|
|
|
|
# MANAGE SCRIPT FAILURE
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
# Exit if an error occurs during the execution of the script
|
|
|
|
ynh_abort_if_errors
|
|
|
|
|
2017-05-01 15:47:20 +02:00
|
|
|
#=================================================
|
|
|
|
# LOAD SETTINGS
|
|
|
|
#=================================================
|
2019-05-18 20:15:36 +02:00
|
|
|
ynh_script_progression --message="Loading installation settings..." --weight=2
|
2017-05-01 15:47:20 +02:00
|
|
|
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
|
2019-05-18 20:15:36 +02:00
|
|
|
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
|
|
|
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
|
2017-05-01 15:47:20 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD BACKUP STEPS
|
|
|
|
#=================================================
|
|
|
|
# BACKUP OF THE MAIN DIR OF THE APP
|
|
|
|
#=================================================
|
2019-05-18 20:15:36 +02:00
|
|
|
ynh_script_progression --message="Backing up the main app directory..."
|
2017-05-01 15:47:20 +02:00
|
|
|
|
2019-05-18 20:15:36 +02:00
|
|
|
ynh_backup --src_path="$final_path"
|
2017-05-01 15:47:20 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# BACKUP OF THE NGINX CONFIGURATION
|
|
|
|
#=================================================
|
2019-05-18 20:15:36 +02:00
|
|
|
ynh_script_progression --message="Backing up nginx web server configuration..."
|
2017-05-01 15:47:20 +02:00
|
|
|
|
2019-05-18 20:15:36 +02:00
|
|
|
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
2017-05-01 15:47:20 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# SPECIFIC BACKUP
|
|
|
|
#=================================================
|
|
|
|
# BACKUP OF THE UWSGI CONFIG
|
|
|
|
#=================================================
|
2019-05-18 20:15:36 +02:00
|
|
|
ynh_script_progression --message="Backing up uWSGI configuration..."
|
2017-05-01 15:47:20 +02:00
|
|
|
|
2019-05-18 20:15:36 +02:00
|
|
|
ynh_backup --src_path="/etc/uwsgi/apps-available/$app.ini"
|
2019-03-03 20:33:02 +01:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
|
|
|
|
2019-05-18 20:15:36 +02:00
|
|
|
ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --last
|