2018-02-06 14:33:23 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-02-11 00:32:26 +01:00
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
|
2018-02-06 14:33:23 +01:00
|
|
|
# Source YunoHost helpers
|
|
|
|
source /usr/share/yunohost/helpers
|
|
|
|
|
|
|
|
# Stop script if errors
|
|
|
|
ynh_abort_if_errors
|
|
|
|
|
|
|
|
# Import common cmd
|
|
|
|
source ../settings/scripts/experimental_helper.sh
|
|
|
|
source ../settings/scripts/_common.sh
|
|
|
|
|
|
|
|
final_path=$(ynh_app_setting_get $app final_path)
|
|
|
|
domain=$(ynh_app_setting_get $app domain)
|
|
|
|
db_name=$(ynh_app_setting_get $app db_name)
|
|
|
|
|
2018-02-11 00:32:26 +01:00
|
|
|
#=================================================
|
|
|
|
# STANDARD BACKUP STEPS
|
|
|
|
#=================================================
|
|
|
|
|
2018-02-06 14:33:23 +01:00
|
|
|
# BACKUP THE APP MAIN DIR
|
|
|
|
ynh_backup "$final_path"
|
|
|
|
|
|
|
|
# Backup user data
|
|
|
|
ynh_backup "$gollem_data_dir" "user_data" 1
|
|
|
|
|
|
|
|
# BACKUP THE NGINX CONFIGURATION
|
|
|
|
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
|
|
|
|
|
|
|
|
# BACKUP THE PHP-FPM CONFIGURATION
|
|
|
|
ynh_backup "/etc/php5/fpm/pool.d/$app.conf"
|
|
|
|
ynh_backup "/etc/php5/fpm/conf.d/20-$app.ini"
|
|
|
|
|
|
|
|
# BACKUP THE MYSQL DATABASE
|
|
|
|
ynh_mysql_dump_db "$db_name" > db.sql
|