@@ -283,7 +283,7 @@ do_backup_instance(PGconn *backup_conn, PGNodeInfo *nodeInfo, bool no_sync, bool
283283
284284 /* initialize backup's file list */
285285 backup_files_list = parray_new ();
286- join_path_components (external_prefix , current .database_dir , EXTERNAL_DIR );
286+ join_path_components (external_prefix , current .root_dir , EXTERNAL_DIR );
287287
288288 /* list files with the logical path. omit $PGDATA */
289289 if (fio_is_remote (FIO_DB_HOST ))
@@ -738,6 +738,11 @@ do_backup(pgSetBackupParams *set_backup_params,
738738 /* Initialize PGInfonode */
739739 pgNodeInit (& nodeInfo );
740740
741+ /* Save list of external directories */
742+ if (instance_config .external_dir_str &&
743+ (pg_strcasecmp (instance_config .external_dir_str , "none" ) != 0 ))
744+ current .external_dir_str = instance_config .external_dir_str ;
745+
741746 /* Create backup directory and BACKUP_CONTROL_FILE */
742747 pgBackupCreateDir (& current , backup_instance_path );
743748
@@ -755,11 +760,6 @@ do_backup(pgSetBackupParams *set_backup_params,
755760 current .compress_alg = instance_config .compress_alg ;
756761 current .compress_level = instance_config .compress_level ;
757762
758- /* Save list of external directories */
759- if (instance_config .external_dir_str &&
760- (pg_strcasecmp (instance_config .external_dir_str , "none" ) != 0 ))
761- current .external_dir_str = instance_config .external_dir_str ;
762-
763763 elog (INFO , "Backup start, pg_probackup version: %s, instance: %s, backup ID: %s, backup mode: %s, "
764764 "wal mode: %s, remote: %s, compress-algorithm: %s, compress-level: %i" ,
765765 PROGRAM_VERSION , instance_name , base36enc (current .backup_id ), pgBackupGetBackupMode (& current ),
0 commit comments