mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2025-05-15 22:46:36 +02:00
check file existence in archive-push
This commit is contained in:
parent
70ff5aaa27
commit
6b4c90a25e
@ -65,6 +65,9 @@ do_archive_push(char *wal_file_path, char *wal_file_name)
|
|||||||
join_path_components(absolute_wal_file_path, current_dir, wal_file_path);
|
join_path_components(absolute_wal_file_path, current_dir, wal_file_path);
|
||||||
join_path_components(backup_wal_file_path, arclog_path, wal_file_name);
|
join_path_components(backup_wal_file_path, arclog_path, wal_file_name);
|
||||||
|
|
||||||
|
if (access(absolute_wal_file_path, F_OK) != -1)
|
||||||
|
elog(ERROR, "file '%s', already exists.", absolute_wal_file_path);
|
||||||
|
|
||||||
elog(INFO, "pg_probackup archive-push from %s to %s", absolute_wal_file_path, backup_wal_file_path);
|
elog(INFO, "pg_probackup archive-push from %s to %s", absolute_wal_file_path, backup_wal_file_path);
|
||||||
copy_wal_file(absolute_wal_file_path, backup_wal_file_path);
|
copy_wal_file(absolute_wal_file_path, backup_wal_file_path);
|
||||||
elog(INFO, "pg_probackup archive-push completed successfully");
|
elog(INFO, "pg_probackup archive-push completed successfully");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user