@@ -111,15 +111,17 @@ catalog_get_backup_list(time_t backup_id)
111111DIR * date_dir = NULL ;
112112struct dirent * date_ent = NULL ;
113113DIR * time_dir = NULL ;
114+ char backups_path [MAXPGPATH ];
114115char date_path [MAXPGPATH ];
115116parray * backups = NULL ;
116117pgBackup * backup = NULL ;
117118
118119/* open backup root directory */
119- date_dir = opendir (backup_path );
120+ join_path_components (backups_path ,backup_path ,BACKUPS_DIR );
121+ date_dir = opendir (backups_path );
120122if (date_dir == NULL )
121123{
122- elog (WARNING ,"cannot open directory \"%s\": %s" ,backup_path ,
124+ elog (WARNING ,"cannot open directory \"%s\": %s" ,backups_path ,
123125strerror (errno ));
124126gotoerr_proc ;
125127}
@@ -131,15 +133,11 @@ catalog_get_backup_list(time_t backup_id)
131133char ini_path [MAXPGPATH ];
132134
133135/* skip not-directory entries and hidden entries */
134- if (!IsDir (backup_path ,date_ent -> d_name )|| date_ent -> d_name [0 ]== '.' )
135- continue ;
136-
137- /* skip online WAL backup directory */
138- if (strcmp (date_ent -> d_name ,RESTORE_WORK_DIR )== 0 )
136+ if (!IsDir (backups_path ,date_ent -> d_name )|| date_ent -> d_name [0 ]== '.' )
139137continue ;
140138
141139/* open subdirectory (date directory) and search time directory */
142- join_path_components (date_path ,backup_path ,date_ent -> d_name );
140+ join_path_components (date_path ,backups_path ,date_ent -> d_name );
143141
144142/* read backup information from backup.ini */
145143snprintf (ini_path ,MAXPGPATH ,"%s/%s" ,date_path ,BACKUP_INI_FILE );
@@ -166,7 +164,7 @@ catalog_get_backup_list(time_t backup_id)
166164if (errno )
167165{
168166elog (WARNING ,"cannot read backup root directory \"%s\": %s" ,
169- backup_path ,strerror (errno ));
167+ backups_path ,strerror (errno ));
170168gotoerr_proc ;
171169}
172170
@@ -492,9 +490,9 @@ pgBackupGetPath(const pgBackup *backup, char *path, size_t len, const char *subd
492490
493491datetime = base36enc (backup -> start_time );
494492if (subdir )
495- snprintf (path ,len ,"%s/%s/%s" ,backup_path ,datetime ,subdir );
493+ snprintf (path ,len ,"%s/%s/%s/%s " ,backup_path , BACKUPS_DIR ,datetime ,subdir );
496494else
497- snprintf (path ,len ,"%s/%s" ,backup_path ,datetime );
495+ snprintf (path ,len ,"%s/%s/%s " ,backup_path , BACKUPS_DIR ,datetime );
498496free (datetime );
499497}
500498