2016-03-18 18:38:54 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-08-14 22:18:22 +02:00
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
2016-03-18 18:38:54 +01:00
|
|
|
|
2018-08-14 22:18:22 +02:00
|
|
|
# Source YunoHost helpers
|
|
|
|
source /usr/share/yunohost/helpers
|
2016-03-18 18:38:54 +01:00
|
|
|
|
2018-08-14 22:18:22 +02:00
|
|
|
# Stop script if errors
|
|
|
|
ynh_abort_if_errors
|
2016-03-18 18:38:54 +01:00
|
|
|
|
2018-08-14 22:18:22 +02:00
|
|
|
# Import common cmd
|
|
|
|
source ../settings/scripts/experimental_helper.sh
|
|
|
|
source ../settings/scripts/_common.sh
|
2016-03-18 18:38:54 +01:00
|
|
|
|
2018-08-14 22:18:22 +02:00
|
|
|
domain=$(ynh_app_setting_get $app domain)
|
|
|
|
db_name=$(ynh_app_setting_get $app db_name)
|
2016-03-18 18:38:54 +01:00
|
|
|
|
2018-08-14 22:18:22 +02:00
|
|
|
#=================================================
|
|
|
|
# STANDARD BACKUP STEPS
|
|
|
|
#=================================================
|
2016-03-18 18:38:54 +01:00
|
|
|
|
2018-08-14 22:18:22 +02:00
|
|
|
# BACKUP THE NGINX CONFIGURATION
|
|
|
|
ynh_backup "/etc/nginx/conf.d/$domain.d/$app.conf"
|
|
|
|
|
|
|
|
# Backup SOGo config
|
|
|
|
ynh_backup "/etc/$app"
|
|
|
|
|
|
|
|
# Backup stunnel config
|
|
|
|
ynh_backup "/etc/stunnel/$app.conf"
|
|
|
|
|
|
|
|
# Backup Logs
|
|
|
|
ynh_backup "/var/log/$app"
|
|
|
|
|
|
|
|
# Backup Cron
|
|
|
|
ynh_backup "/etc/cron.d/$app"
|
|
|
|
|
|
|
|
# BACKUP THE MYSQL DATABASE
|
|
|
|
ynh_mysql_dump_db "$db_name" > db.sql
|