#!/bin/bash # Source YunoHost helpers source /usr/share/yunohost/helpers # Stop script if errors ynh_abort_if_errors # Import common cmd source ../settings/scripts/_common.sh source ../settings/scripts/psql.sh # Retrieve arguments domain=$(ynh_app_setting_get $app special_domain) final_path="/opt/yunohost/matrix-synapse" # Copy Nginx config ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf" "nginx.conf" # Backup synapse config ynh_backup "/etc/matrix-synapse" "synapse_config" # Backup coturn server ynh_backup "/etc/turnserver.conf" "coturn_config" ynh_backup "/etc/default/coturn" "coturn_config_default" # Backup synapse database ynh_backup "/var/lib/matrix-synapse" "data" 1 # Backup Postgresql database sudo su -c "pg_dump $synapse_db_name" postgres > ${YNH_CWD}/dump.sql # Copy the logs ynh_backup "/var/log/matrix-synapse" "log" ynh_backup "/var/log/turnserver" "log_turnserver" # Backup systemd service ynh_backup "/etc/default/matrix-synapse" ynh_backup "/etc/systemd/system/matrix-synapse.service" # Backup synapse binary ynh_backup "$final_path" "bin"