mirror of
https://github.com/YunoHost-Apps/synapse_ynh.git
synced 2024-09-03 20:26:38 +02:00
Fix backup / restore
This commit is contained in:
parent
0d1e2e97bc
commit
effd809a22
2 changed files with 3 additions and 6 deletions
|
@ -31,7 +31,7 @@ upstream_version=$(ynh_app_upstream_version)
|
|||
#=================================================
|
||||
|
||||
domain=$(ynh_app_setting_get $app special_domain)
|
||||
final_path="/opt/yunohost/matrix-$app"
|
||||
final_path=$(ynh_app_setting_get $app final_path)
|
||||
|
||||
#=================================================
|
||||
# STANDARD BACKUP STEPS
|
||||
|
@ -79,7 +79,7 @@ ynh_backup "/var/lib/matrix-$app" "data" 1
|
|||
# BACKUP THE POSTGRESQL DATABASE
|
||||
#=================================================
|
||||
|
||||
sudo su -c "pg_dump $synapse_db_name" postgres > ${YNH_CWD}/dump.sql
|
||||
ynh_psql_dump_db "$synapse_db_name" > ${YNH_CWD}/dump.sql
|
||||
|
||||
#=================================================
|
||||
# BACKUP SYNAPSE LOG
|
||||
|
|
|
@ -34,12 +34,9 @@ domain=$(ynh_app_setting_get $app special_domain)
|
|||
path_url=$(ynh_app_setting_get $app special_path)
|
||||
final_path=$(ynh_app_setting_get $app final_path)
|
||||
synapse_db_pwd=$(ynh_app_setting_get $app synapse_db_pwd)
|
||||
is_public=$(ynh_app_setting_get $app is_public)
|
||||
port=$(ynh_app_setting_get $app synapse_port)
|
||||
synapse_tls_port=$(ynh_app_setting_get $app synapse_tls_port)
|
||||
turnserver_tls_port=$(ynh_app_setting_get $app turnserver_tls_port)
|
||||
turnserver_alt_tls_port=$(ynh_app_setting_get $app turnserver_alt_tls_port)
|
||||
turnserver_pwd=$(ynh_app_setting_get $app turnserver_pwd)
|
||||
|
||||
#=================================================
|
||||
# CHECK IF THE APP CAN BE RESTORED
|
||||
|
@ -106,7 +103,7 @@ ynh_psql_execute_as_root \
|
|||
LC_CTYPE='C'
|
||||
template=template0
|
||||
OWNER $synapse_db_user;"
|
||||
su -c "psql $synapse_db_name" postgres < ${YNH_CWD}/dump.sql
|
||||
ynh_psql_execute_file_as_root "${YNH_CWD}/dump.sql" "$synapse_db_name"
|
||||
|
||||
#=================================================
|
||||
# RESTORE SYSTEMD
|
||||
|
|
Loading…
Add table
Reference in a new issue