2017-02-06 00:55:47 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-03-13 21:49:11 +01:00
|
|
|
#=================================================
|
|
|
|
# GENERIC STARTING
|
|
|
|
#=================================================
|
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
#=================================================
|
|
|
|
source /usr/share/yunohost/helpers
|
2017-02-06 00:55:47 +01:00
|
|
|
|
2018-03-13 21:49:11 +01:00
|
|
|
#=================================================
|
|
|
|
# MANAGE SCRIPT FAILURE
|
|
|
|
#=================================================
|
2017-02-06 00:55:47 +01:00
|
|
|
|
2018-03-13 21:49:11 +01:00
|
|
|
# Exit if an error occurs during the execution of the script
|
|
|
|
ynh_abort_if_errors
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# LOAD SETTINGS
|
|
|
|
#=================================================
|
2017-02-07 02:00:31 +01:00
|
|
|
|
2017-02-06 00:55:47 +01:00
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
|
2017-02-06 23:50:47 +01:00
|
|
|
domain=$(ynh_app_setting_get $app domain)
|
2018-03-13 21:49:11 +01:00
|
|
|
final_path=$(ynh_app_setting_get $app final_path)
|
|
|
|
db_name=$(ynh_app_setting_get $app db_name)
|
|
|
|
db_pwd=$(ynh_app_setting_get $app mysqlpwd)
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD BACKUP STEPS
|
|
|
|
#=================================================
|
|
|
|
# BACKUP OF THE MAIN DIR OF THE APP
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_backup "$final_path"
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# BACKUP OF THE NGINX CONFIGURATION
|
|
|
|
#=================================================
|
|
|
|
|
|
|
|
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
|
2017-02-06 00:55:47 +01:00
|
|
|
|
2018-03-13 21:49:11 +01:00
|
|
|
#=================================================
|
|
|
|
# BACKUP OF THE PHP-FPM CONFIGURATION
|
|
|
|
#=================================================
|
2017-02-07 02:00:31 +01:00
|
|
|
|
2018-03-13 21:49:11 +01:00
|
|
|
ynh_backup "/etc/php5/fpm/pool.d/$app.conf"
|
|
|
|
ynh_backup "/etc/php5/fpm/conf.d/20-$app.ini"
|
2017-02-06 00:55:47 +01:00
|
|
|
|
2018-03-13 21:49:11 +01:00
|
|
|
#=================================================
|
|
|
|
# BACKUP OF THE SQL BDD
|
|
|
|
#=================================================
|
2017-02-06 00:55:47 +01:00
|
|
|
|
2018-03-13 21:49:11 +01:00
|
|
|
ynh_mysql_dump_db "$db_name" > db.sql
|