diff --git a/bin/pg_backrest.pl b/bin/pg_backrest.pl index d57de64e8..feb395f5f 100755 --- a/bin/pg_backrest.pl +++ b/bin/pg_backrest.pl @@ -85,7 +85,7 @@ use constant CONFIG_KEY_HARDLINK => 'hardlink', CONFIG_KEY_ARCHIVE_REQUIRED => 'archive-required', CONFIG_KEY_ARCHIVE_MAX_MB => 'archive-max-mb', - CONFIG_KEY_START_FAST => 'start_fast', + CONFIG_KEY_START_FAST => 'start-fast', CONFIG_KEY_COMPRESS_ASYNC => 'compress-async', CONFIG_KEY_LEVEL_FILE => 'level-file', @@ -591,7 +591,7 @@ if ($strOperation eq OP_ARCHIVE_GET) &log(INFO, 'getting archive log ' . $ARGV[1]); # Get the archive file - remote_exit(archive_get($ARGV[1], $ARGV[2])); + remote_exit(archive_get(config_key_load(CONFIG_SECTION_STANZA, CONFIG_KEY_PATH), $ARGV[1], $ARGV[2])); } #################################################################################################################################### diff --git a/lib/BackRest/Backup.pm b/lib/BackRest/Backup.pm index 219d81e2f..d20ac29c7 100644 --- a/lib/BackRest/Backup.pm +++ b/lib/BackRest/Backup.pm @@ -229,9 +229,21 @@ sub backup_thread_complete #################################################################################################################################### sub archive_get { + my $strDbClusterPath = shift; my $strSourceArchive = shift; my $strDestinationFile = shift; + # If the destination file path is not absolute then it is relative to the data path + if (index($strDestinationFile, '/',) != 0) + { + if (!defined($strDbClusterPath)) + { + confess &log(ERROR, 'database path must be set if relative xlog paths are used'); + } + + $strDestinationFile = "${strDbClusterPath}/${strDestinationFile}"; + } + # Determine the path where the requested archive file is located my $strArchivePath = dirname($oFile->path_get(PATH_BACKUP_ARCHIVE, $strSourceArchive));