diff --git a/scripts/backup b/scripts/backup index 39c6e64..ec25863 100644 --- a/scripts/backup +++ b/scripts/backup @@ -49,7 +49,7 @@ fi # BACKUP THE POSTGRESQL DATABASE #================================================= -ynh_psql_dump_db --database="$synapse_db_name" > ${YNH_CWD}/dump.sql +ynh_psql_dump_db --database="$db_name" > ${YNH_CWD}/dump.sql #================================================= # BACKUP FAIL2BAN CONFIGURATION @@ -79,7 +79,7 @@ ynh_backup --src_path="/etc/systemd/system/$app-coturn.service" # BACKUP SYNAPSE DATA #================================================= -ynh_backup --src_path="$data_path" --is_big=1 +ynh_backup --src_path="$data_dir" --is_big=1 #================================================= # BACKUP SYNAPSE LOG diff --git a/scripts/restore b/scripts/restore index 57f1e0d..01a1601 100644 --- a/scripts/restore +++ b/scripts/restore @@ -58,7 +58,7 @@ ynh_systemd_action --action=restart --service_name=fail2ban #================================================= ynh_script_progression --message="Restoring the PostgreSQL database..." --weight=13 -ynh_psql_execute_file_as_root --file="${YNH_CWD}/dump.sql" --database="$synapse_db_name" +ynh_psql_execute_file_as_root --file="${YNH_CWD}/dump.sql" --database="$db_name" #================================================= # RESTORE SYSTEMD diff --git a/scripts/upgrade b/scripts/upgrade index 671f89f..b3c78ec 100644 --- a/scripts/upgrade +++ b/scripts/upgrade @@ -240,13 +240,13 @@ ynh_script_progression --message='Managing migrations...' #================================================= if [ -e "/var/lib/matrix-$app" ]; then - ynh_script_progression --message="Moving data directory to $data_path..." --weight=1 - if [ -e "$data_path" ]; then - old_data_dir_path="$data_path$(date '+%Y%m%d.%H%M%S')" + ynh_script_progression --message="Moving data directory to $data_dir..." --weight=1 + if [ -e "$data_dir" ]; then + old_data_dir_path="$data_dir$(date '+%Y%m%d.%H%M%S')" ynh_print_warn "A data directory already exist. Data was renamed to $old_data_dir_path" - mv "$data_path" "$old_data_dir_path" + mv "$data_dir" "$old_data_dir_path" fi - mv "/var/lib/matrix-$app" "$data_path" + mv "/var/lib/matrix-$app" "$data_dir" fi #=================================================