2016-05-14 10:06:20 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-06-13 23:37:51 +02:00
|
|
|
#=================================================
|
2019-05-01 13:24:56 +02:00
|
|
|
# GENERIC START
|
2017-06-13 23:37:51 +02:00
|
|
|
#=================================================
|
2019-05-01 13:24:56 +02:00
|
|
|
# IMPORT GENERIC HELPERS
|
2017-06-13 23:37:51 +02:00
|
|
|
#=================================================
|
|
|
|
|
2019-05-01 13:24:56 +02:00
|
|
|
source ../settings/scripts/_common.sh
|
|
|
|
source /usr/share/yunohost/helpers
|
2016-05-14 10:06:20 +02:00
|
|
|
|
2017-06-13 23:37:51 +02:00
|
|
|
#=================================================
|
2019-05-01 13:24:56 +02:00
|
|
|
# MANAGE SCRIPT FAILURE
|
2017-06-13 23:37:51 +02:00
|
|
|
#=================================================
|
|
|
|
|
2019-05-01 13:24:56 +02:00
|
|
|
# Exit if an error occurs during the execution of the script
|
|
|
|
ynh_abort_if_errors
|
2017-06-13 23:37:51 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# LOAD SETTINGS
|
|
|
|
#=================================================
|
2019-05-01 13:24:56 +02:00
|
|
|
ynh_script_progression --message="Loading installation settings..."
|
2016-05-14 10:06:20 +02:00
|
|
|
|
|
|
|
app=$YNH_APP_INSTANCE_NAME
|
|
|
|
|
2019-05-01 13:24:56 +02:00
|
|
|
domain=$(ynh_app_setting_get --app=$app --key=domain)
|
2017-06-13 23:37:51 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# STANDARD BACKUP STEPS
|
|
|
|
#=================================================
|
|
|
|
# BACKUP OF THE NGINX CONFIGURATION
|
|
|
|
#=================================================
|
2019-05-01 13:24:56 +02:00
|
|
|
ynh_script_progression --message="Backing up nginx web server configuration..."
|
2017-06-13 23:37:51 +02:00
|
|
|
|
2019-05-01 13:24:56 +02:00
|
|
|
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
|
2017-06-13 23:37:51 +02:00
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# SPECIFIC BACKUP
|
|
|
|
#=================================================
|
|
|
|
# BACKUP TRANSMISSION CONFIGURATION
|
|
|
|
#=================================================
|
2019-05-01 13:24:56 +02:00
|
|
|
ynh_script_progression --message="Backing up transmission configuration..."
|
2017-06-13 23:37:51 +02:00
|
|
|
|
2019-05-01 13:24:56 +02:00
|
|
|
ynh_backup --src_path="/etc/transmission-daemon/settings.json"
|
2019-05-09 11:07:57 +02:00
|
|
|
ynh_backup --src_path="/etc/sysctl.d/90-transmission.conf"
|
2016-05-14 10:06:20 +02:00
|
|
|
|
2017-06-13 23:37:51 +02:00
|
|
|
#=================================================
|
|
|
|
# BACKUP DATA
|
|
|
|
#=================================================
|
2019-05-01 13:24:56 +02:00
|
|
|
ynh_script_progression --message="Backing up transmission data..."
|
2016-05-14 10:06:20 +02:00
|
|
|
|
2019-05-01 13:24:56 +02:00
|
|
|
ynh_backup --src_path="/usr/share/transmission"
|
|
|
|
ynh_backup --src_path="/var/lib/transmission-daemon"
|
2016-05-14 10:06:20 +02:00
|
|
|
|
2019-05-01 13:24:56 +02:00
|
|
|
ynh_backup --src_path="/home/yunohost.transmission" --is_big
|
|
|
|
|
|
|
|
#=================================================
|
|
|
|
# END OF SCRIPT
|
|
|
|
#=================================================
|
2017-06-16 20:38:31 +02:00
|
|
|
|
2019-05-01 13:24:56 +02:00
|
|
|
ynh_script_progression --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)." --last
|