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

60 lines
1.9 KiB
Text
Raw Normal View History

2016-05-07 18:21:06 +02:00
#!/bin/bash
#=================================================
# GENERIC STARTING
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
2016-05-07 18:21:06 +02:00
2019-03-03 20:32:26 +01:00
# source ../settings/scripts/_common.sh
source /usr/share/yunohost/helpers
2016-05-07 18:21:06 +02:00
2018-05-28 00:30:42 +02:00
#=================================================
# MANAGE SCRIPT FAILURE
#=================================================
# Exit if an error occurs during the execution of the script
ynh_abort_if_errors
#=================================================
# LOAD SETTINGS
#=================================================
2020-09-19 16:09:37 +02:00
ynh_print_info --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME
2019-05-18 20:15:36 +02:00
domain=$(ynh_app_setting_get --app=$app --key=domain)
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
#=================================================
2020-09-19 16:09:37 +02:00
# DECLARE DATA AND CONF FILES TO BACKUP
#=================================================
ynh_print_info --message="Declaring files to be backed up..."
#=================================================
# BACKUP OF THE MAIN DIR OF THE APP
#=================================================
2019-05-18 20:15:36 +02:00
ynh_backup --src_path="$final_path"
#=================================================
# BACKUP OF THE NGINX CONFIGURATION
#=================================================
2019-05-18 20:15:36 +02:00
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
#=================================================
# SPECIFIC BACKUP
#=================================================
# BACKUP OF THE UWSGI CONFIG
#=================================================
2020-04-10 22:02:55 +02:00
ynh_backup --src_path "/etc/uwsgi/apps-available/$app.ini"
ynh_backup --src_path "/var/log/uwsgi/$app"
2019-03-03 20:33:02 +01:00
#=================================================
# END OF SCRIPT
#=================================================
2020-09-19 16:47:18 +02:00
ynh_print_info --message="Backup script completed for Searx. (YunoHost will then actually copy those files to the archive)."