1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/horde_ynh.git synced 2024-09-03 19:16:08 +02:00
horde_ynh/scripts/backup
2018-02-06 14:33:23 +01:00

34 lines
No EOL
802 B
Bash
Executable file

#!/bin/bash
# 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
# LOAD SETTINGS
app=$YNH_APP_INSTANCE_NAME
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)
# 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