@@ -111,15 +111,17 @@ catalog_get_backup_list(time_t backup_id)
111
111
DIR * date_dir = NULL ;
112
112
struct dirent * date_ent = NULL ;
113
113
DIR * time_dir = NULL ;
114
+ char backups_path [MAXPGPATH ];
114
115
char date_path [MAXPGPATH ];
115
116
parray * backups = NULL ;
116
117
pgBackup * backup = NULL ;
117
118
118
119
/* 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 );
120
122
if (date_dir == NULL )
121
123
{
122
- elog (WARNING ,"cannot open directory \"%s\": %s" ,backup_path ,
124
+ elog (WARNING ,"cannot open directory \"%s\": %s" ,backups_path ,
123
125
strerror (errno ));
124
126
gotoerr_proc ;
125
127
}
@@ -131,15 +133,11 @@ catalog_get_backup_list(time_t backup_id)
131
133
char ini_path [MAXPGPATH ];
132
134
133
135
/* 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 ]== '.' )
139
137
continue ;
140
138
141
139
/* 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 );
143
141
144
142
/* read backup information from backup.ini */
145
143
snprintf (ini_path ,MAXPGPATH ,"%s/%s" ,date_path ,BACKUP_INI_FILE );
@@ -166,7 +164,7 @@ catalog_get_backup_list(time_t backup_id)
166
164
if (errno )
167
165
{
168
166
elog (WARNING ,"cannot read backup root directory \"%s\": %s" ,
169
- backup_path ,strerror (errno ));
167
+ backups_path ,strerror (errno ));
170
168
gotoerr_proc ;
171
169
}
172
170
@@ -492,9 +490,9 @@ pgBackupGetPath(const pgBackup *backup, char *path, size_t len, const char *subd
492
490
493
491
datetime = base36enc (backup -> start_time );
494
492
if (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 );
496
494
else
497
- snprintf (path ,len ,"%s/%s" ,backup_path ,datetime );
495
+ snprintf (path ,len ,"%s/%s/%s " ,backup_path , BACKUPS_DIR ,datetime );
498
496
free (datetime );
499
497
}
500
498