Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 6b4c90a

Browse files
committed
check file existence in archive-push
1 parent 70ff5aa commit 6b4c90a

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/archive.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,9 @@ do_archive_push(char *wal_file_path, char *wal_file_name)
6565
join_path_components(absolute_wal_file_path, current_dir, wal_file_path);
6666
join_path_components(backup_wal_file_path, arclog_path, wal_file_name);
6767

68+
if (access(absolute_wal_file_path, F_OK) != -1)
69+
elog(ERROR, "file '%s', already exists.", absolute_wal_file_path);
70+
6871
elog(INFO, "pg_probackup archive-push from %s to %s", absolute_wal_file_path, backup_wal_file_path);
6972
copy_wal_file(absolute_wal_file_path, backup_wal_file_path);
7073
elog(INFO, "pg_probackup archive-push completed successfully");

0 commit comments

Comments
 (0)