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

59 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)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
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"
#=================================================
# SPECIFIC BACKUP
#=================================================
2019-10-23 10:16:15 +02:00
# BACKUP LOGROTATE AND LOG FILE
2019-10-15 15:56:27 +02:00
#=================================================
ynh_backup --src_path="/etc/logrotate.d/$app"
2019-10-23 10:16:15 +02:00
ynh_backup --src_path="/var/log/$app.log"
2019-10-15 15:56:27 +02:00
#=================================================
# 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)."