1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/tvheadend_ynh.git synced 2024-10-01 13:34:50 +02:00
tvheadend_ynh/scripts/backup

56 lines
1.9 KiB
Text
Raw Normal View History

2019-10-15 15:56:27 +02:00
#!/bin/bash
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
2020-10-13 18:23:23 +02:00
2019-10-15 15:56:27 +02:00
source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
2020-10-13 18:23:23 +02:00
2019-10-15 15:56:27 +02:00
ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================
2020-10-13 18:23:23 +02:00
ynh_print_info --message="Loading installation settings..."
2019-10-15 15:56:27 +02:00
app=$YNH_APP_INSTANCE_NAME
domain=$(ynh_app_setting_get --app=$app --key=domain)
path_url=$(ynh_app_setting_get --app=$app --key=path)
superuser=$(ynh_app_setting_get --app=$app --key=superuser)
password=$(ynh_app_setting_get --app=$app --key=password)
2019-10-15 15:56:27 +02:00
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
conf_dir=$(ynh_app_setting_get --app=$app --key=conf_dir)
port=$(ynh_app_setting_get --app=$app --key=port)
stream_port=$(ynh_app_setting_get --app=$app --key=stream_port)
2019-10-15 15:56:27 +02:00
#=================================================
2020-10-13 18:23:23 +02:00
# DECLARE DATA AND CONF FILES TO BACKUP
2019-10-15 15:56:27 +02:00
#=================================================
2020-10-13 18:23:23 +02:00
ynh_print_info --message="Declaring files to be backed up..."
2019-10-15 15:56:27 +02:00
#=================================================
2019-10-23 10:16:15 +02:00
# BACKUP THE APP MAIN DIR AND CONFIG FILES
2019-10-15 15:56:27 +02:00
#=================================================
ynh_backup --src_path="/etc/default/tvheadend"
2019-10-23 10:16:15 +02:00
ynh_backup --src_path="$final_path"
2019-10-15 15:56:27 +02:00
#=================================================
# BACKUP THE NGINX CONFIGURATION
#=================================================
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# END OF SCRIPT
#=================================================
2020-10-13 18:23:23 +02:00
ynh_print_info --message="Backup script completed for Tvheadend. (YunoHost will then actually copy those files to the archive)."