1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/redirect_ynh.git synced 2024-09-03 20:16:10 +02:00
redirect_ynh/scripts/backup

39 lines
1.2 KiB
Text
Raw Normal View History

2016-06-20 23:43:51 +02:00
#!/bin/bash
2018-05-26 10:27:01 +02:00
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
2016-06-20 23:43:51 +02:00
2018-05-26 10:27:01 +02:00
source /usr/share/yunohost/helpers
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================
2021-01-23 15:21:17 +01:00
ynh_print_info --message="Loading installation settings..."
2016-06-20 23:43:51 +02:00
# Retrieve arguments
2019-05-15 18:42:44 +02:00
app=$YNH_APP_INSTANCE_NAME
2021-08-22 08:58:18 +02:00
domain=$(ynh_app_setting_get --app=$app --key=domain)
2016-06-20 23:43:51 +02:00
2021-01-23 15:21:17 +01:00
#=================================================
# BACKUP THE NGINX CONFIGURATION
#=================================================
2016-06-20 23:43:51 +02:00
# Copy the conf files
2019-05-15 18:42:44 +02:00
ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf"
2021-01-23 15:21:17 +01:00
#=================================================
# END OF SCRIPT
#=================================================
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."