mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-03-03 14:52:21 +02:00
Fixed relative path issue in archive-get.
This commit is contained in:
parent
121cb8a811
commit
82b0bc0e72
@ -584,7 +584,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]));
|
||||
}
|
||||
|
||||
####################################################################################################################################
|
||||
|
@ -218,9 +218,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));
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user