qr_ynh/scripts/backup

18 lines
686 B
Bash
Executable File

#!/bin/bash
source /usr/share/yunohost/helpers
ynh_abort_if_errors
ynh_print_info --message="Loading installation settings..."
app=$YNH_APP_INSTANCE_NAME
final_path=$(ynh_app_setting_get --app=$app --key=final_path)
domain=$(ynh_app_setting_get --app=$app --key=domain)
phpversion=$(ynh_app_setting_get --app=$app --key=phpversion)
ynh_print_info --message="Declaring files to be backed up..."
ynh_backup --src_path="$final_path"
ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf"
ynh_backup --src_path="/etc/php/$phpversion/fpm/pool.d/$app.conf"
ynh_print_info --message="Backup script completed for $app. (YunoHost will then actually copy those files to the archive)."