1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/sogo_ynh.git synced 2024-09-03 20:26:07 +02:00
sogo_ynh/scripts/backup
2018-08-16 00:01:10 +02:00

40 lines
906 B
Bash
Executable file

#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# 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
domain=$(ynh_app_setting_get $app domain)
db_name=$(ynh_app_setting_get $app db_name)
#=================================================
# STANDARD BACKUP STEPS
#=================================================
# 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