diff --git a/scripts/backup b/scripts/backup index ef34234..c8e6a74 100644 --- a/scripts/backup +++ b/scripts/backup @@ -15,6 +15,8 @@ domain=$(ynh_app_setting_get --app="$app" --key=domain) # definie useful vars final_path="/opt/yunohost/$app" data_path="/home/yunohost.app/$app" +log_file="/var/log/$app/$app.log" +path_url="/" # backup source & conf files ynh_print_info --message="Declaring files to be backed up..." @@ -24,5 +26,6 @@ ynh_backup --src_path="/etc/nginx/conf.d/$domain.d/$app.conf" ynh_backup --src_path="/etc/sudoers.d/$app" ynh_backup --src_path="/etc/systemd/system/$app.service" ynh_backup --src_path="/etc/logrotate.d/$app" +ynh_backup --src_path="$(dirname "$log_file")" ynh_print_info --message="Backup of $app completed" diff --git a/scripts/remove b/scripts/remove index 9271bdb..ec11286 100644 --- a/scripts/remove +++ b/scripts/remove @@ -14,6 +14,7 @@ port=$(ynh_app_setting_get --app=$app --key=port) final_path="/opt/yunohost/$app" data_path="/home/yunohost.app/$app" log_file="/var/log/$app/$app.log" +path_url="/" # Remove a service from the admin panel, added by `yunohost service add` if ynh_exec_warn_less yunohost service status "$app" >/dev/null ; then diff --git a/scripts/restore b/scripts/restore index 5472f39..c8db173 100644 --- a/scripts/restore +++ b/scripts/restore @@ -50,6 +50,11 @@ ynh_restore_file --origin_path="$data_path" chown -R $app: "$data_path" chmod -R +x "$data_path/.$app/bin" +# restore log +ynh_script_progression --message="Restoring the app..." +ynh_restore_file --origin_path="$(dirname "$log_file")" +chown -R $app: "$log_file" + # add required packages ynh_script_progression --message="Restoring the packages dependencies..." myynh_install_dependencies --python="$python"