1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/ffsync_ynh.git synced 2024-09-03 18:26:38 +02:00
ffsync_ynh/scripts/backup

48 lines
1.5 KiB
Text
Raw Normal View History

#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
source /usr/share/yunohost/helpers
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
# Import common cmd
source ../settings/scripts/experimental_helper.sh
source ../settings/scripts/_common.sh
# LOAD SETTINGS
ynh_script_progression --message="Loading installation settings..."
final_path=$(ynh_app_setting_get --app $app --key final_path)
domain=$(ynh_app_setting_get --app $app --key domain)
db_name=$(ynh_app_setting_get --app $app --key db_name)
#=================================================
# STANDARD BACKUP STEPS
#=================================================
# BACKUP THE APP MAIN DIR
ynh_script_progression --message="Backing up the main app directory..."
ynh_backup --src_path "$final_path"
# BACKUP THE NGINX CONFIGURATION
ynh_script_progression --message="Backing configuration..."
ynh_backup --src_path "/etc/nginx/conf.d/$domain.d/$app.conf"
# BACKUP THE MYSQL DATABASE
ynh_script_progression --message="Backing up database"
ynh_mysql_dump_db "$db_name" > db.sql
2018-09-05 22:35:25 +02:00
# Backup Log
ynh_script_progression --message="Backing up logs"
ynh_backup --src_path "/var/log/uwsgi/$app"
2018-07-05 23:21:03 +02:00
# BACKUP THE UWSGI FILES
ynh_script_progression --message="Backing up configuration..."
ynh_backup --src_path "/etc/uwsgi/apps-available/$app.ini"
ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --last