2016-08-15 15:38:50 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-02-08 17:25:54 +01:00
|
|
|
#=================================================
|
|
|
|
# GENERIC START
|
|
|
|
#=================================================
|
|
|
|
|
2018-02-07 00:31:25 +01:00
|
|
|
# IMPORT GENERIC HELPERS
|
|
|
|
source /usr/share/yunohost/helpers
|
2016-08-15 15:38:50 +02:00
|
|
|
|
2018-02-07 00:31:25 +01:00
|
|
|
# Exit if an error occurs during the execution of the script
|
|
|
|
ynh_abort_if_errors
|
2016-08-15 15:38:50 +02:00
|
|
|
|
2018-02-07 00:31:25 +01:00
|
|
|
# Load common variables and helpers
|
2018-02-07 23:49:32 +01:00
|
|
|
source ../settings/scripts/experimental_helper.sh
|
|
|
|
source ../settings/scripts/_common.sh
|
2016-08-15 15:38:50 +02:00
|
|
|
|
|
|
|
# Retrieve app settings
|
|
|
|
domain=$(ynh_app_setting_get "$app" domain)
|
|
|
|
|
2018-02-08 17:25:54 +01:00
|
|
|
#=================================================
|
|
|
|
# STANDARD BACKUP STEPS
|
|
|
|
#=================================================
|
|
|
|
|
2016-08-15 15:38:50 +02:00
|
|
|
# Copy the app source files
|
2018-02-07 23:49:32 +01:00
|
|
|
ynh_backup "$final_path"
|
2016-08-15 15:38:50 +02:00
|
|
|
|
|
|
|
# Copy the data files
|
2018-02-07 00:31:25 +01:00
|
|
|
ynh_backup "$DATADIR"
|
2016-08-15 15:38:50 +02:00
|
|
|
|
|
|
|
# Copy the conf files
|
2018-02-07 00:31:25 +01:00
|
|
|
ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf"
|
|
|
|
ynh_backup "/etc/systemd/system/${app}.service"
|
2016-08-15 15:38:50 +02:00
|
|
|
|
2018-02-08 11:42:15 +01:00
|
|
|
# Backup logs
|
|
|
|
ynh_backup "/var/log/$app"
|
|
|
|
|
2016-08-15 15:38:50 +02:00
|
|
|
# Dump the database
|
2018-02-08 17:25:54 +01:00
|
|
|
ynh_mysql_dump_db "$dbname" > ./db.sql
|