diff --git a/.gitignore b/.gitignore
index 84476cb84..0b3cdd414 100644
--- a/.gitignore
+++ b/.gitignore
@@ -3,3 +3,5 @@
*.swp
test/test
test/vm/.vagrant
+test/nytprof.out
+test/nytprof/*
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 411dd767e..b636af627 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,7 +3,13 @@
## v0.85: DALLAS MILESTONE - UNDER DEVELOPMENT
__No Release Date Set__
-*
+* Fixed an issue where resumed compressed backups were not preserving existing files.
+
+* Fixed an issue where resume and incr/diff would not ensure that the prior backup has the same compression and hardlink settings.
+
+* Code cleanup and refactoring to standardize on patterns that have evolved over time.
+
+* Experimental support for PostgreSQL 9.5 alpha2. This may break when the control version or WAL magic changes in future versions but will be updated in each pgBackRest release to keep pace. All regression tests pass except for `--target-resume` tests (this functionality has changed in 9.5) and there is no testing yet for `.partial` WAL segments.
## v0.80: DBI Support, Stability, and Convenience Features
__Released August 9, 2015__
diff --git a/USERGUIDE.md b/USERGUIDE.md
index d5be22cc4..329f6535b 100644
--- a/USERGUIDE.md
+++ b/USERGUIDE.md
@@ -261,7 +261,7 @@ Path to the backrest repository where WAL segments, backups, logs, etc are store
The repository serves as both storage and working area for pgBackRest. In a simple installation where the backups are stored locally to the database server there will be only one repository which will contain everything: backups, archives, logs, locks, etc.
-If the backups are being done remotely then the backup server's repository will contain backups, archives, locks and logs while the database server's repository will contain only locks and logs. However, if asynchronous archving is enabled then the database server's repository will also contain a spool directory for archive logs that have not yet been pushed to the remote repository.
+If the backups are being done remotely then the backup server's repository will contain backups, archives, locks and logs while the database server's repository will contain only locks and logs. However, if asynchronous archiving is enabled then the database server's repository will also contain a spool directory for archive logs that have not yet been pushed to the remote repository.
Each system where pgBackRest is installed should have a repository directory configured. Storage requirements vary based on usage. The main backup repository will need the most space as it contains both backups and WAL segments for whatever retention you have specified. The database repository only needs significant space if asynchronous archiving is enabled and then it will act as an overflow for WAL segments and might need to be large depending on your database activity.
diff --git a/bin/pg_backrest b/bin/pg_backrest
index 05675cc78..002d4f7c0 100755
--- a/bin/pg_backrest
+++ b/bin/pg_backrest
@@ -10,33 +10,53 @@ use strict;
use warnings FATAL => qw(all);
use Carp qw(confess);
+# Convert die to confess to capture the stack trace
$SIG{__DIE__} = sub { Carp::confess @_ };
use File::Basename qw(dirname);
use Scalar::Util qw(blessed);
use lib dirname($0) . '/../lib';
-use BackRest::Backup;
use BackRest::Archive;
+use BackRest::Backup;
+use BackRest::Common::Exception;
+use BackRest::Common::Lock;
+use BackRest::Common::Log;
use BackRest::Config;
-use BackRest::Db;
-use BackRest::Exception;
+use BackRest::Expire;
use BackRest::File;
use BackRest::Info;
-use BackRest::Lock;
use BackRest::Protocol::RemoteMinion;
+use BackRest::Protocol::ThreadGroup;
use BackRest::Restore;
-use BackRest::ThreadGroup;
-use BackRest::Utility;
####################################################################################################################################
-# SAFE_EXIT - terminate all threads and SSH connections when the script is terminated
+# Operation constants
####################################################################################################################################
-sub safe_exit
+use constant OP_MAIN => 'Main';
+
+use constant OP_MAIN_SAFE_EXIT => OP_MAIN . '::safeExit';
+
+####################################################################################################################################
+# safeExit
+#
+# Terminate all threads and SSH connections when the script is terminated.
+####################################################################################################################################
+sub safeExit
{
- my $iExitCode = shift;
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $iExitCode
+ ) =
+ logDebugParam
+ (
+ OP_MAIN_SAFE_EXIT, \@_,
+ {name => 'iExitCode', required => false}
+ );
- &log(DEBUG, "safe exit called, terminating threads");
+ commandStop();
my $iTotal = threadGroupDestroy();
protocolDestroy();
@@ -49,9 +69,9 @@ sub safe_exit
&log(ERROR, "process terminated on signal or exception, ${iTotal} threads stopped");
}
-$SIG{TERM} = \&safe_exit;
-$SIG{HUP} = \&safe_exit;
-$SIG{INT} = \&safe_exit;
+$SIG{TERM} = \&safeExit;
+$SIG{HUP} = \&safeExit;
+$SIG{INT} = \&safeExit;
####################################################################################################################################
# START EVAL BLOCK TO CATCH ERRORS AND STOP THREADS
@@ -69,7 +89,7 @@ eval
if (commandTest(CMD_REMOTE))
{
# Turn all logging off
- log_level_set(OFF, OFF);
+ logLevelSet(OFF, OFF);
# Create the remote object
my $oRemote = new BackRest::Protocol::RemoteMinion
@@ -80,21 +100,24 @@ eval
);
# Process remote requests
- safe_exit($oRemote->process());
+ safeExit($oRemote->process());
}
# Set the log levels
- log_level_set(optionGet(OPTION_LOG_LEVEL_FILE), optionGet(OPTION_LOG_LEVEL_CONSOLE));
+ logLevelSet(optionGet(OPTION_LOG_LEVEL_FILE), optionGet(OPTION_LOG_LEVEL_CONSOLE));
# Set test options
- !optionGet(OPTION_TEST) or test_set(optionGet(OPTION_TEST), optionGet(OPTION_TEST_DELAY));
+ !optionGet(OPTION_TEST) or testSet(optionGet(OPTION_TEST), optionGet(OPTION_TEST_DELAY));
+
+ # Log the command start
+ commandStart();
################################################################################################################################
# Process archive commands
################################################################################################################################
if (commandTest(CMD_ARCHIVE_PUSH) || commandTest(CMD_ARCHIVE_GET))
{
- safe_exit(new BackRest::Archive()->process());
+ safeExit(new BackRest::Archive()->process());
}
################################################################################################################################
@@ -102,7 +125,7 @@ eval
################################################################################################################################
if (commandTest(CMD_INFO))
{
- safe_exit(new BackRest::Info()->info());
+ safeExit(new BackRest::Info()->process());
}
################################################################################################################################
@@ -113,7 +136,7 @@ eval
################################################################################################################################
# Open the log file
################################################################################################################################
- log_file_set(optionGet(OPTION_REPO_PATH) . '/log/' . optionGet(OPTION_STANZA) . '-' . lc(commandGet()));
+ logFileSet(optionGet(OPTION_REPO_PATH) . '/log/' . optionGet(OPTION_STANZA) . '-' . lc(commandGet()));
################################################################################################################################
# Create the thread group that will be used for parallel processing
@@ -144,25 +167,10 @@ eval
# Do the restore
new BackRest::Restore
(
- optionGet(OPTION_DB_PATH),
- optionGet(OPTION_SET),
- optionGet(OPTION_RESTORE_TABLESPACE_MAP, false),
- $oFile,
- optionGet(OPTION_THREAD_MAX),
- optionGet(OPTION_DELTA),
- optionGet(OPTION_FORCE),
- optionGet(OPTION_TYPE),
- optionGet(OPTION_TARGET, false),
- optionGet(OPTION_TARGET_EXCLUSIVE, false),
- optionGet(OPTION_TARGET_RESUME, false),
- optionGet(OPTION_TARGET_TIMELINE, false),
- optionGet(OPTION_RESTORE_RECOVERY_SETTING, false),
- optionGet(OPTION_STANZA),
- $0,
- optionGet(OPTION_CONFIG)
- )->restore;
+ $oFile
+ )->process;
- safe_exit(0);
+ safeExit(0);
}
################################################################################################################################
@@ -178,21 +186,10 @@ eval
################################################################################################################################
if (commandTest(CMD_BACKUP))
{
- # Run backup_init - parameters required for backup commands
- backup_init
+ new BackRest::Backup
(
- $oFile,
- new BackRest::Db(),
- optionGet(OPTION_TYPE),
- optionGet(OPTION_COMPRESS),
- optionGet(OPTION_HARDLINK),
- optionGet(OPTION_THREAD_MAX),
- optionGet(OPTION_THREAD_TIMEOUT, false),
- optionGet(OPTION_NO_START_STOP),
- optionTest(OPTION_FORCE)
- );
-
- backup(optionGet(OPTION_DB_PATH), optionGet(OPTION_START_FAST));
+ $oFile
+ )->process();
commandSet(CMD_EXPIRE);
}
@@ -202,28 +199,16 @@ eval
################################################################################################################################
if (commandTest(CMD_EXPIRE))
{
- backup_init
+ new BackRest::Expire
(
$oFile
- );
-
- backup_expire
- (
- $oFile->path_get(PATH_BACKUP_CLUSTER),
- optionGet(OPTION_RETENTION_FULL, false),
- optionGet(OPTION_RETENTION_DIFF, false),
- optionGet(OPTION_RETENTION_ARCHIVE_TYPE, false),
- optionGet(OPTION_RETENTION_ARCHIVE, false)
- );
+ )->process();
}
- # Cleanup backup (should be removed when backup becomes an object)
- backup_cleanup();
-
# Release the command lock
lockRelease();
- safe_exit(0);
+ safeExit(0);
};
####################################################################################################################################
@@ -234,11 +219,11 @@ if ($@)
my $oMessage = $@;
# If a backrest exception then return the code - don't confess
- if (blessed($oMessage) && $oMessage->isa('BackRest::Exception'))
+ if (blessed($oMessage) && $oMessage->isa('BackRest::Common::Exception'))
{
- safe_exit($oMessage->code());
+ safeExit($oMessage->code());
}
- safe_exit();
+ safeExit();
confess $oMessage;
}
diff --git a/doc/doc.pl b/doc/doc.pl
index 0dcb8fcab..977bb543c 100755
--- a/doc/doc.pl
+++ b/doc/doc.pl
@@ -19,8 +19,9 @@ use Pod::Usage qw(pod2usage);
use XML::Checker::Parser;
use lib dirname($0) . '/../lib';
+use BackRest::Common::Log;
+use BackRest::Common::String;
use BackRest::Config;
-use BackRest::Utility;
####################################################################################################################################
# Usage
@@ -681,7 +682,7 @@ if ($bQuiet)
$strLogLevel = 'off';
}
-log_level_set(undef, uc($strLogLevel));
+logLevelSet(undef, uc($strLogLevel));
my $strBasePath = abs_path(dirname($0));
diff --git a/doc/xml/changelog.xml b/doc/xml/changelog.xml
index d4b5856ff..f7cea337b 100644
--- a/doc/xml/changelog.xml
+++ b/doc/xml/changelog.xml
@@ -9,7 +9,16 @@
-
+ Fixed an issue where resumed compressed backups were not preserving existing files.
+
+
+ Fixed an issue where resume and incr/diff would not ensure that the prior backup has the same compression and hardlink settings.
+
+
+ Code cleanup and refactoring to standardize on patterns that have evolved over time.
+
+
+ Experimental support for 9.5 alpha2. This may break when the control version or WAL magic changes in future versions but will be updated in each release to keep pace. All regression tests pass except for --target-resume tests (this functionality has changed in 9.5) and there is no testing yet for .partial WAL segments.
diff --git a/doc/xml/userguide.xml b/doc/xml/userguide.xml
index 6bb580ccd..c95cbc56b 100644
--- a/doc/xml/userguide.xml
+++ b/doc/xml/userguide.xml
@@ -258,7 +258,7 @@
The repository serves as both storage and working area for pgBackRest. In a simple installation where the backups are stored locally to the database server there will be only one repository which will contain everything: backups, archives, logs, locks, etc.
- If the backups are being done remotely then the backup server's repository will contain backups, archives, locks and logs while the database server's repository will contain only locks and logs. However, if asynchronous archving is enabled then the database server's repository will also contain a spool directory for archive logs that have not yet been pushed to the remote repository.
+ If the backups are being done remotely then the backup server's repository will contain backups, archives, locks and logs while the database server's repository will contain only locks and logs. However, if asynchronous archiving is enabled then the database server's repository will also contain a spool directory for archive logs that have not yet been pushed to the remote repository.
Each system where is installed should have a repository directory configured. Storage requirements vary based on usage. The main backup repository will need the most space as it contains both backups and WAL segments for whatever retention you have specified. The database repository only needs significant space if asynchronous archiving is enabled and then it will act as an overflow for WAL segments and might need to be large depending on your database activity.
diff --git a/lib/BackRest/Archive.pm b/lib/BackRest/Archive.pm
index 02b7ccf64..56ab5e761 100644
--- a/lib/BackRest/Archive.pm
+++ b/lib/BackRest/Archive.pm
@@ -8,28 +8,40 @@ use warnings FATAL => qw(all);
use Carp qw(confess);
use Exporter qw(import);
-use Fcntl qw(SEEK_CUR O_RDONLY O_WRONLY O_CREAT O_EXCL);
+ our @EXPORT = qw();
+use Fcntl qw(SEEK_CUR O_RDONLY O_WRONLY O_CREAT);
use File::Basename qw(dirname basename);
use lib dirname($0);
+use BackRest::Common::Exception;
+use BackRest::Common::Ini;
+use BackRest::Common::Lock;
+use BackRest::Common::Log;
use BackRest::ArchiveInfo;
+use BackRest::Common::String;
+use BackRest::Common::Wait;
use BackRest::Config;
-use BackRest::Exception;
use BackRest::File;
-use BackRest::Ini;
-use BackRest::Lock;
-#use BackRest::Protocol::Protocol;
-use BackRest::Utility;
####################################################################################################################################
# Operation constants
####################################################################################################################################
use constant OP_ARCHIVE => 'Archive';
-use constant OP_ARCHIVE_PUSH_CHECK => OP_ARCHIVE . '->pushCheck';
- our @EXPORT = qw(OP_ARCHIVE_PUSH_CHECK);
+use constant OP_ARCHIVE_GET => OP_ARCHIVE . '->get';
use constant OP_ARCHIVE_GET_CHECK => OP_ARCHIVE . '->getCheck';
push @EXPORT, qw(OP_ARCHIVE_GET_CHECK);
+use constant OP_ARCHIVE_GET_PROCESS => OP_ARCHIVE . '->getProcess';
+use constant OP_ARCHIVE_NEW => OP_ARCHIVE . '->new';
+use constant OP_ARCHIVE_PROCESS => OP_ARCHIVE . '->process';
+use constant OP_ARCHIVE_PUSH => OP_ARCHIVE . '->pushProcess';
+use constant OP_ARCHIVE_PUSH_CHECK => OP_ARCHIVE . '->pushCheck';
+ push @EXPORT, qw(OP_ARCHIVE_PUSH_CHECK);
+use constant OP_ARCHIVE_PUSH_PROCESS => OP_ARCHIVE . '->pushProcess';
+use constant OP_ARCHIVE_RANGE => OP_ARCHIVE . '->range';
+use constant OP_ARCHIVE_WAL_FILE_NAME => OP_ARCHIVE . '->walFileName';
+use constant OP_ARCHIVE_WAL_INFO => OP_ARCHIVE . '->walInfo';
+use constant OP_ARCHIVE_XFER => OP_ARCHIVE . '->xfer';
####################################################################################################################################
# constructor
@@ -38,11 +50,26 @@ sub new
{
my $class = shift; # Class name
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation
+ ) =
+ logDebugParam
+ (
+ OP_ARCHIVE_NEW
+ );
+
# Create the class hash
my $self = {};
bless $self, $class;
- return $self;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'self', value => $self}
+ );
}
####################################################################################################################################
@@ -54,20 +81,40 @@ sub process
{
my $self = shift;
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation
+ ) =
+ logDebugParam
+ (
+ OP_ARCHIVE_PROCESS
+ );
+
+ my $iResult;
+
# Process push
if (commandTest(CMD_ARCHIVE_PUSH))
{
- return $self->pushProcess();
+ $iResult = $self->pushProcess();
}
-
# Process get
- if (commandTest(CMD_ARCHIVE_GET))
+ elsif (commandTest(CMD_ARCHIVE_GET))
{
- return $self->getProcess();
+ $iResult = $self->getProcess();
+ }
+ # Else error if any other command is found
+ else
+ {
+ confess &log(ASSERT, "Archive->process() called with invalid command: " . commandGet());
}
- # Error if any other command is found
- confess &log(ASSERT, "Archive->process() called with invalid command: " . commandGet());
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'iResult', value => $iResult, trace => true}
+ );
}
################################################################################################################################
@@ -77,6 +124,16 @@ sub getProcess
{
my $self = shift;
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation
+ ) =
+ logDebugParam
+ (
+ OP_ARCHIVE_GET_PROCESS
+ );
+
# Make sure the archive file is defined
if (!defined($ARGV[1]))
{
@@ -90,10 +147,14 @@ sub getProcess
}
# Info for the Postgres log
- &log(INFO, 'getting WAL segment ' . $ARGV[1]);
+ &log(INFO, 'get WAL segment ' . $ARGV[1]);
- # Get the WAL segment
- return $self->get($ARGV[1], $ARGV[2]);
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'iResult', value => $self->get($ARGV[1], $ARGV[2]), trace => true}
+ );
}
####################################################################################################################################
@@ -105,44 +166,58 @@ sub getProcess
sub walFileName
{
my $self = shift;
- my $oFile = shift;
- my $strArchiveId = shift;
- my $strWalSegment = shift;
- my $iWaitSeconds = shift;
+
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $oFile,
+ $strArchiveId,
+ $strWalSegment,
+ $iWaitSeconds
+ ) =
+ logDebugParam
+ (
+ OP_ARCHIVE_WAL_FILE_NAME, \@_,
+ {name => 'oFile'},
+ {name => 'strArchiveId'},
+ {name => 'strWalSegment'},
+ {name => 'iWaitSeconds', required => false}
+ );
# Record the start time
my $oWait = waitInit($iWaitSeconds);
# Determine the path where the requested WAL segment is located
- my $strArchivePath = dirname($oFile->path_get(PATH_BACKUP_ARCHIVE, "$strArchiveId/${strWalSegment}"));
+ my $strArchivePath = dirname($oFile->pathGet(PATH_BACKUP_ARCHIVE, "$strArchiveId/${strWalSegment}"));
+ my @stryWalFileName;
do
{
# Get the name of the requested WAL segment (may have hash info and compression extension)
- my @stryWalFileName = $oFile->list(PATH_BACKUP_ABSOLUTE, $strArchivePath,
+ @stryWalFileName = $oFile->list(PATH_BACKUP_ABSOLUTE, $strArchivePath,
"^${strWalSegment}(-[0-f]+){0,1}(\\.$oFile->{strCompressExtension}){0,1}\$", undef, true);
- # If there is only one result then return it
- if (@stryWalFileName == 1)
- {
- return $stryWalFileName[0];
- }
-
# If there is more than one matching archive file then there is a serious issue - likely a bug in the archiver
if (@stryWalFileName > 1)
{
confess &log(ASSERT, @stryWalFileName . " duplicate files found for ${strWalSegment}", ERROR_ARCHIVE_DUPLICATE);
}
}
- while (waitMore($oWait));
+ while (@stryWalFileName == 0 && waitMore($oWait));
# If waiting and no WAL segment was found then throw an error
- if (defined($iWaitSeconds))
+ if (@stryWalFileName == 0 && defined($iWaitSeconds))
{
confess &log(ERROR, "could not find WAL segment ${strWalSegment} after " . waitInterval($oWait) . ' second(s)');
}
- return undef;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'strWalFileName', value => $stryWalFileName[0]}
+ );
}
####################################################################################################################################
@@ -153,11 +228,18 @@ sub walFileName
sub walInfo
{
my $self = shift;
- my $strWalFile = shift;
- # Set operation and debug strings
- my $strOperation = 'Archive->walInfo';
- &log(TRACE, "${strOperation}: " . PATH_ABSOLUTE . ":${strWalFile}");
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strWalFile,
+ ) =
+ logDebugParam
+ (
+ OP_ARCHIVE_WAL_INFO, \@_,
+ {name => 'strWalFile'}
+ );
# Open the WAL segment
my $hFile;
@@ -238,6 +320,7 @@ sub walInfo
my $iFlag = unpack('S', $tBlock);
+ # Make sure that the long header is present or there won't be a system id
$iFlag & 2
or confess &log(ERROR, "expected long header in flags " . sprintf("%x", $iFlag));
@@ -255,9 +338,13 @@ sub walInfo
my $ullDbSysId = unpack('Q', $tBlock);
- &log(TRACE, sprintf("${strOperation}: WAL magic = 0x%X, database system id = ", $iMagic) . $ullDbSysId);
-
- return $strDbVersion, $ullDbSysId;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'strDbVersion', value => $strDbVersion},
+ {name => 'ullDbSysId', value => $ullDbSysId}
+ );
}
####################################################################################################################################
@@ -266,8 +353,20 @@ sub walInfo
sub get
{
my $self = shift;
- my $strSourceArchive = shift;
- my $strDestinationFile = shift;
+
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strSourceArchive,
+ $strDestinationFile
+ ) =
+ logDebugParam
+ (
+ OP_ARCHIVE_GET, \@_,
+ {name => 'strSourceArchive'},
+ {name => 'strDestinationFile'}
+ );
# Create the file object
my $oFile = new BackRest::File
@@ -281,9 +380,11 @@ sub get
# If the destination file path is not absolute then it is relative to the db data path
if (index($strDestinationFile, '/',) != 0)
{
+ # !!! If db-path is required this is can be removed.
+ # !!! db-path should be added as a requirement for the remote settings work.
if (!optionTest(OPTION_DB_PATH))
{
- confess &log(ERROR, 'database path must be set if relative xlog paths are used');
+ confess &log(ERROR, 'option db-path must be set when relative xlog paths are used');
}
$strDestinationFile = optionGet(OPTION_DB_PATH) . "/${strDestinationFile}";
@@ -298,25 +399,32 @@ sub get
# 2) There is a hole in the archive stream and a hard error should be returned. However, holes are possible due to
# async archiving and threading - so when to report a hole? Since a hard error will cause PG to terminate, for now
# treat as case #1.
+ my $iResult = 0;
+
if (!defined($strArchiveFile))
{
- &log(INFO, "${strSourceArchive} was not found in the archive repository");
+ &log(INFO, "unable to find ${strSourceArchive} in the archive");
- return 1;
+ $iResult = 1;
+ }
+ else
+ {
+ # Determine if the source file is already compressed
+ my $bSourceCompressed = $strArchiveFile =~ "^.*\.$oFile->{strCompressExtension}\$" ? true : false;
+
+ # Copy the archive file to the requested location
+ $oFile->copy(PATH_BACKUP_ARCHIVE, "${strArchiveId}/${strArchiveFile}", # Source file
+ PATH_DB_ABSOLUTE, $strDestinationFile, # Destination file
+ $bSourceCompressed, # Source compression based on detection
+ false); # Destination is not compressed
}
- &log(DEBUG, "archive_get: cp ${strArchiveFile} ${strDestinationFile}");
-
- # Determine if the source file is already compressed
- my $bSourceCompressed = $strArchiveFile =~ "^.*\.$oFile->{strCompressExtension}\$" ? true : false;
-
- # Copy the archive file to the requested location
- $oFile->copy(PATH_BACKUP_ARCHIVE, "${strArchiveId}/${strArchiveFile}", # Source file
- PATH_DB_ABSOLUTE, $strDestinationFile, # Destination file
- $bSourceCompressed, # Source compression based on detection
- false); # Destination is not compressed
-
- return 0;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'iResult', value => $iResult}
+ );
}
####################################################################################################################################
@@ -327,21 +435,33 @@ sub getCheck
my $self = shift;
my $oFile = shift;
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation
+ ) =
+ logDebugParam
+ (
+ OP_ARCHIVE_GET_CHECK
+ );
+
my $strArchiveId;
- if ($oFile->is_remote(PATH_BACKUP_ARCHIVE))
+ if ($oFile->isRemote(PATH_BACKUP_ARCHIVE))
{
$strArchiveId = $oFile->{oProtocol}->cmdExecute(OP_ARCHIVE_GET_CHECK, undef, true);
}
else
{
- $strArchiveId = (new BackRest::ArchiveInfo($oFile->path_get(PATH_BACKUP_ARCHIVE), true))->archiveId();
+ $strArchiveId = (new BackRest::ArchiveInfo($oFile->pathGet(PATH_BACKUP_ARCHIVE), true))->archiveId();
}
- # Set operation and debug strings
- &log(DEBUG, OP_ARCHIVE_GET_CHECK . "=>: archiveId = ${strArchiveId}");
-
- return $strArchiveId;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'strArchiveId', value => $strArchiveId, trace => true}
+ );
}
####################################################################################################################################
@@ -351,6 +471,16 @@ sub pushProcess
{
my $self = shift;
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation
+ ) =
+ logDebugParam
+ (
+ OP_ARCHIVE_PUSH_PROCESS
+ );
+
# Make sure the archive push command happens on the db side
if (optionRemoteTypeTest(DB))
{
@@ -388,63 +518,69 @@ sub pushProcess
}
}
- &log(INFO, 'pushing WAL segment ' . $ARGV[1] . ($bArchiveAsync ? ' asynchronously' : ''));
+ &log(INFO, 'push WAL segment ' . $ARGV[1] . ($bArchiveAsync ? ' asynchronously' : ''));
$self->push($ARGV[1], $bArchiveAsync);
- # Exit if we are not archiving async
- if (!$bArchiveAsync)
+ # Fork is async archiving is enabled
+ if ($bArchiveAsync)
{
- return 0;
- }
-
- # Fork and exit the parent process so the async process can continue
- if (!optionTest(OPTION_TEST_NO_FORK) || !optionGet(OPTION_TEST_NO_FORK))
- {
- if (fork())
+ # Fork and disable the async archive flag if this is the parent process
+ if (!optionTest(OPTION_TEST_NO_FORK) || !optionGet(OPTION_TEST_NO_FORK))
{
- return 0;
+ $bArchiveAsync = fork() == 0 ? true : false;
+ }
+ # Else the no-fork flag has been specified for testing
+ else
+ {
+ logDebugMisc($strOperation, 'no fork on archive local for TESTING');
}
}
- # Else the no-fork flag has been specified for testing
- else
- {
- &log(DEBUG, 'No fork on archive local for TESTING');
- }
+ }
+ if ($bArchiveAsync)
+ {
# Start the async archive push
- &log(DEBUG, 'starting async archive-push');
- }
+ logDebugMisc($strOperation, 'start async archive-push');
- # Create a lock file to make sure async archive-push does not run more than once
- if (!lockAcquire(commandGet(), false))
- {
- &log(DEBUG, 'another async archive-push process is already running - exiting');
- return 0;
- }
-
- # Open the log file
- log_file_set(optionGet(OPTION_REPO_PATH) . '/log/' . optionGet(OPTION_STANZA) . '-archive-async');
-
- # Call the archive_xfer function and continue to loop as long as there are files to process
- my $iLogTotal;
-
- while (!defined($iLogTotal) || $iLogTotal > 0)
- {
- $iLogTotal = $self->xfer($strArchivePath . "/archive/" . optionGet(OPTION_STANZA) . "/out", $strStopFile);
-
- if ($iLogTotal > 0)
+ # Create a lock file to make sure async archive-push does not run more than once
+ if (!lockAcquire(commandGet(), false))
{
- &log(DEBUG, "transferred ${iLogTotal} WAL segment(s), calling Archive->xfer() again");
+ logDebugMisc($strOperation, 'async archive-push process is already running - exiting');
}
else
{
- &log(DEBUG, 'transfer found 0 WAL segments - exiting');
+ # Open the log file
+ logFileSet(optionGet(OPTION_REPO_PATH) . '/log/' . optionGet(OPTION_STANZA) . '-archive-async');
+
+ # Call the archive_xfer function and continue to loop as long as there are files to process
+ my $iLogTotal;
+
+ while (!defined($iLogTotal) || $iLogTotal > 0)
+ {
+ $iLogTotal = $self->xfer($strArchivePath . "/archive/" . optionGet(OPTION_STANZA) . "/out", $strStopFile);
+
+ if ($iLogTotal > 0)
+ {
+ logDebugMisc($strOperation, "transferred ${iLogTotal} WAL segment" .
+ ($iLogTotal > 1 ? 's' : '') . ', calling Archive->xfer() again');
+ }
+ else
+ {
+ logDebugMisc($strOperation, 'transfer found 0 WAL segments - exiting');
+ }
+ }
+
+ lockRelease();
}
}
- lockRelease();
- return 0;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'iResult', value => 0, trace => true}
+ );
}
####################################################################################################################################
@@ -453,8 +589,20 @@ sub pushProcess
sub push
{
my $self = shift;
- my $strSourceFile = shift;
- my $bAsync = shift;
+
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strSourceFile,
+ $bAsync
+ ) =
+ logDebugParam
+ (
+ OP_ARCHIVE_PUSH, \@_,
+ {name => 'strSourceFile'},
+ {name => 'bAsync'}
+ );
# Create the file object
my $oFile = new BackRest::File
@@ -470,7 +618,7 @@ sub push
{
if (!optionTest(OPTION_DB_PATH))
{
- confess &log(ERROR, 'database path must be set if relative xlog paths are used');
+ confess &log(ERROR, 'option db-path must be set when relative xlog paths are used');
}
$strSourceFile = optionGet(OPTION_DB_PATH) . "/${strSourceFile}";
@@ -524,6 +672,12 @@ sub push
undef, undef, # User and group
$bArchiveFile); # Append checksum if archive file
}
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation
+ );
}
####################################################################################################################################
@@ -532,19 +686,32 @@ sub push
sub pushCheck
{
my $self = shift;
- my $oFile = shift;
- my $strWalSegment = shift;
- my $strWalFile = shift;
- my $strDbVersion = shift;
- my $ullDbSysId = shift;
+
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $oFile,
+ $strWalSegment,
+ $strWalFile,
+ $strDbVersion,
+ $ullDbSysId
+ ) =
+ logDebugParam
+ (
+ OP_ARCHIVE_PUSH_CHECK, \@_,
+ {name => 'oFile'},
+ {name => 'strWalSegment'},
+ {name => 'strWalFile', required => false},
+ {name => 'strDbVersion'},
+ {name => 'ullDbSysId'}
+ );
# Set operation and debug strings
- my $strOperation = OP_ARCHIVE_PUSH_CHECK;
- &log(DEBUG, "${strOperation}: " . PATH_BACKUP_ARCHIVE . ":${strWalSegment}");
my $strChecksum;
my $strArchiveId;
- if ($oFile->is_remote(PATH_BACKUP_ARCHIVE))
+ if ($oFile->isRemote(PATH_BACKUP_ARCHIVE))
{
# Build param hash
my %oParamHash;
@@ -553,11 +720,8 @@ sub pushCheck
$oParamHash{'db-version'} = $strDbVersion;
$oParamHash{'db-sys-id'} = $ullDbSysId;
- # Output remote trace info
- &log(TRACE, "${strOperation}: remote (" . $oFile->{oProtocol}->commandParamString(\%oParamHash) . ')');
-
# Execute the command
- my $strResult = $oFile->{oProtocol}->cmdExecute($strOperation, \%oParamHash, true);
+ my $strResult = $oFile->{oProtocol}->cmdExecute(OP_ARCHIVE_PUSH_CHECK, \%oParamHash, true);
$strArchiveId = (split("\t", $strResult))[0];
$strChecksum = (split("\t", $strResult))[1];
@@ -572,11 +736,11 @@ sub pushCheck
# Create the archive path if it does not exist
if (!$oFile->exists(PATH_BACKUP_ARCHIVE))
{
- $oFile->path_create(PATH_BACKUP_ARCHIVE);
+ $oFile->pathCreate(PATH_BACKUP_ARCHIVE);
}
# If the info file exists check db version and system-id
- $strArchiveId = (new BackRest::ArchiveInfo($oFile->path_get(PATH_BACKUP_ARCHIVE)))->check($strDbVersion, $ullDbSysId);
+ $strArchiveId = (new BackRest::ArchiveInfo($oFile->pathGet(PATH_BACKUP_ARCHIVE)))->check($strDbVersion, $ullDbSysId);
# Check if the WAL segment already exists in the archive
$strChecksum = $self->walFileName($oFile, $strArchiveId, $strWalSegment);
@@ -598,11 +762,15 @@ sub pushCheck
&log(WARN, "WAL segment ${strWalSegment} already exists in the archive with the same checksum\n" .
"HINT: this is valid in some recovery scenarios but may also indicate a problem");
-
- return $strArchiveId, $strChecksum;
}
- return $strArchiveId, $strChecksum;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'strArchiveId', value => $strArchiveId},
+ {name => 'strChecksum', value => $strChecksum}
+ );
}
####################################################################################################################################
@@ -611,8 +779,20 @@ sub pushCheck
sub xfer
{
my $self = shift;
- my $strArchivePath = shift;
- my $strStopFile = shift;
+
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strArchivePath,
+ $strStopFile
+ ) =
+ logDebugParam
+ (
+ OP_ARCHIVE_XFER, \@_,
+ {name => 'strArchivePath'},
+ {name => 'strStopFile'}
+ );
# Create a local file object to read archive logs in the local store
my $oFile = new BackRest::File
@@ -646,128 +826,140 @@ sub xfer
if ($lFileTotal == 0)
{
- &log(DEBUG, 'no archive logs to be copied to backup');
+ logDebugMisc($strOperation, 'no WAL segments to archive');
return 0;
}
-
- eval
+ else
{
- # If the archive repo is remote create a new file object to do the copies
- if (!optionRemoteTypeTest(NONE))
+ eval
{
- $oFile = new BackRest::File
- (
- optionGet(OPTION_STANZA),
- optionGet(OPTION_REPO_REMOTE_PATH),
- optionRemoteType(),
- protocolGet()
- );
+ # If the archive repo is remote create a new file object to do the copies
+ if (!optionRemoteTypeTest(NONE))
+ {
+ $oFile = new BackRest::File
+ (
+ optionGet(OPTION_STANZA),
+ optionGet(OPTION_REPO_REMOTE_PATH),
+ optionRemoteType(),
+ protocolGet()
+ );
+ }
+
+ # Modify process name to indicate async archiving
+ $0 = $^X . ' ' . $0 . " --stanza=" . optionGet(OPTION_STANZA) .
+ "archive-push-async " . $stryFile[0] . '-' . $stryFile[scalar @stryFile - 1];
+
+ # Output files to be moved to backup
+ &log(INFO, "WAL segments to archive: total = ${lFileTotal}, size = " . fileSizeFormat($lFileSize));
+
+ # Transfer each file
+ foreach my $strFile (sort @stryFile)
+ {
+ # Construct the archive filename to backup
+ my $strArchiveFile = "${strArchivePath}/${strFile}";
+
+ # Determine if the source file is already compressed
+ my $bSourceCompressed = $strArchiveFile =~ "^.*\.$oFile->{strCompressExtension}\$" ? true : false;
+
+ # Determine if this is an archive file (don't want to do compression or checksum on .backup files)
+ my $bArchiveFile = basename($strFile) =~
+ "^[0-F]{24}(-[0-f]+){0,1}(\\.$oFile->{strCompressExtension}){0,1}\$" ? true : false;
+
+ # Figure out whether the compression extension needs to be added or removed
+ my $bDestinationCompress = $bArchiveFile && optionGet(OPTION_COMPRESS);
+ my $strDestinationFile = basename($strFile);
+
+ if (!$bSourceCompressed && $bDestinationCompress)
+ {
+ $strDestinationFile .= ".$oFile->{strCompressExtension}";
+ }
+ elsif ($bSourceCompressed && !$bDestinationCompress)
+ {
+ $strDestinationFile = substr($strDestinationFile, 0, length($strDestinationFile) - 3);
+ }
+
+ logDebugMisc
+ (
+ $strOperation, undef,
+ {name => 'strFile', value => $strFile},
+ {name => 'bArchiveFile', value => $bArchiveFile},
+ {name => 'bSourceCompressed', value => $bSourceCompressed},
+ {name => 'bDestinationCompress', value => $bDestinationCompress}
+ );
+
+ # Check that there are no issues with pushing this WAL segment
+ my $strArchiveId;
+ my $strChecksum = undef;
+
+ if ($bArchiveFile)
+ {
+ my ($strDbVersion, $ullDbSysId) = $self->walInfo($strArchiveFile);
+ ($strArchiveId, $strChecksum) = $self->pushCheck($oFile, substr(basename($strArchiveFile), 0, 24),
+ $strArchiveFile, $strDbVersion, $ullDbSysId);
+ }
+ else
+ {
+ $strArchiveId = $self->getCheck($oFile);
+ }
+
+ # Only copy the WAL segment if checksum is not defined. If checksum is defined it means that the WAL segment already
+ # exists in the repository with the same checksum (else there would have been an error on checksum mismatch).
+ if (!defined($strChecksum))
+ {
+ # Copy the archive file
+ $oFile->copy(PATH_DB_ABSOLUTE, $strArchiveFile, # Source path/file
+ PATH_BACKUP_ARCHIVE, # Destination path
+ "${strArchiveId}/${strDestinationFile}", # Destination file
+ $bSourceCompressed, # Source is not compressed
+ $bDestinationCompress, # Destination compress is configurable
+ undef, undef, undef, # Unused params
+ true); # Create path if it does not exist
+ }
+
+ # Remove the source archive file
+ unlink($strArchiveFile)
+ or confess &log(ERROR, "copied ${strArchiveFile} to archive successfully but unable to remove it locally. " .
+ 'This file will need to be cleaned up manually. If the problem persists, check if ' .
+ CMD_ARCHIVE_PUSH . ' is being run with different permissions in different contexts.');
+
+ # Remove the copied segment from the total size
+ $lFileSize -= $oManifestHash{name}{$strFile}{size};
+ }
+ };
+
+ my $oException = $@;
+
+ # Create a stop file if the archive store exceeds the max even after xfer
+ if (optionTest(OPTION_ARCHIVE_MAX_MB))
+ {
+ my $iArchiveMaxMB = optionGet(OPTION_ARCHIVE_MAX_MB);
+
+ if ($iArchiveMaxMB < int($lFileSize / 1024 / 1024))
+ {
+ &log(ERROR, "local archive queue has exceeded limit of ${iArchiveMaxMB}MB" .
+ " - WAL segments will be discarded until the stop file (${strStopFile}) is removed");
+
+ my $hStopFile;
+ open($hStopFile, '>', $strStopFile)
+ or confess &log(ERROR, "unable to create stop file file ${strStopFile}");
+ close($hStopFile);
+ }
}
- # Modify process name to indicate async archiving
- $0 = $^X . ' ' . $0 . " --stanza=" . optionGet(OPTION_STANZA) .
- "archive-push-async " . $stryFile[0] . '-' . $stryFile[scalar @stryFile - 1];
-
- # Output files to be moved to backup
- &log(INFO, "archive to be copied to backup total ${lFileTotal}, size " . file_size_format($lFileSize));
-
- # Transfer each file
- foreach my $strFile (sort @stryFile)
+ # If there was an exception before throw it now
+ if ($oException)
{
- # Construct the archive filename to backup
- my $strArchiveFile = "${strArchivePath}/${strFile}";
-
- # Determine if the source file is already compressed
- my $bSourceCompressed = $strArchiveFile =~ "^.*\.$oFile->{strCompressExtension}\$" ? true : false;
-
- # Determine if this is an archive file (don't want to do compression or checksum on .backup files)
- my $bArchiveFile = basename($strFile) =~
- "^[0-F]{24}(-[0-f]+){0,1}(\\.$oFile->{strCompressExtension}){0,1}\$" ? true : false;
-
- # Figure out whether the compression extension needs to be added or removed
- my $bDestinationCompress = $bArchiveFile && optionGet(OPTION_COMPRESS);
- my $strDestinationFile = basename($strFile);
-
- if (!$bSourceCompressed && $bDestinationCompress)
- {
- $strDestinationFile .= ".$oFile->{strCompressExtension}";
- }
- elsif ($bSourceCompressed && !$bDestinationCompress)
- {
- $strDestinationFile = substr($strDestinationFile, 0, length($strDestinationFile) - 3);
- }
-
- &log(DEBUG, "archive ${strFile}, is WAL ${bArchiveFile}, source_compressed = ${bSourceCompressed}, " .
- "destination_compress ${bDestinationCompress}, default_compress = " . optionGet(OPTION_COMPRESS));
-
- # Check that there are no issues with pushing this WAL segment
- my $strArchiveId;
- my $strChecksum = undef;
-
- if ($bArchiveFile)
- {
- my ($strDbVersion, $ullDbSysId) = $self->walInfo($strArchiveFile);
- ($strArchiveId, $strChecksum) = $self->pushCheck($oFile, substr(basename($strArchiveFile), 0, 24),
- $strArchiveFile, $strDbVersion, $ullDbSysId);
- }
- else
- {
- $strArchiveId = $self->getCheck($oFile);
- }
-
- # Only copy the WAL segment if checksum is not defined. If checksum is defined it means that the WAL segment already
- # exists in the repository with the same checksum (else there would have been an error on checksum mismatch).
- if (!defined($strChecksum))
- {
- # Copy the archive file
- $oFile->copy(PATH_DB_ABSOLUTE, $strArchiveFile, # Source path/file
- PATH_BACKUP_ARCHIVE, # Destination path
- "${strArchiveId}/${strDestinationFile}", # Destination file
- $bSourceCompressed, # Source is not compressed
- $bDestinationCompress, # Destination compress is configurable
- undef, undef, undef, # Unused params
- true); # Create path if it does not exist
- }
-
- # Remove the source archive file
- unlink($strArchiveFile)
- or confess &log(ERROR, "copied ${strArchiveFile} to archive successfully but unable to remove it locally. " .
- 'This file will need to be cleaned up manually. If the problem persists, check if ' .
- CMD_ARCHIVE_PUSH . ' is being run with different permissions in different contexts.');
-
- # Remove the copied segment from the total size
- $lFileSize -= $oManifestHash{name}{$strFile}{size};
- }
- };
-
- my $oException = $@;
-
- # Create a stop file if the archive store exceeds the max even after xfer
- if (optionTest(OPTION_ARCHIVE_MAX_MB))
- {
- my $iArchiveMaxMB = optionGet(OPTION_ARCHIVE_MAX_MB);
-
- if ($iArchiveMaxMB < int($lFileSize / 1024 / 1024))
- {
- &log(ERROR, "local archive store max size has exceeded limit of ${iArchiveMaxMB}MB" .
- " - WAL segments will be discarded until the stop file (${strStopFile}) is removed");
-
- my $hStopFile;
- open($hStopFile, '>', $strStopFile)
- or confess &log(ERROR, "unable to create stop file file ${strStopFile}");
- close($hStopFile);
+ confess $oException;
}
}
- # If there was an exception before throw it now
- if ($oException)
- {
- confess $oException;
- }
-
- # Return number of files indicating that processing should continue
- return $lFileTotal;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'lFileTotal', value => $lFileTotal}
+ );
}
@@ -780,21 +972,22 @@ sub xfer
sub range
{
my $self = shift;
- my $strArchiveStart = shift;
- my $strArchiveStop = shift;
- my $bSkipFF = shift;
- # strSkipFF default to false
- $bSkipFF = defined($bSkipFF) ? $bSkipFF : false;
-
- if ($bSkipFF)
- {
- &log(TRACE, 'archive_list_get: pre-9.3 database, skipping log FF');
- }
- else
- {
- &log(TRACE, 'archive_list_get: post-9.3 database, including log FF');
- }
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strArchiveStart,
+ $strArchiveStop,
+ $bSkipFF
+ ) =
+ logDebugParam
+ (
+ OP_ARCHIVE_RANGE, \@_,
+ {name => 'strArchiveStart'},
+ {name => 'strArchiveStop'},
+ {name => 'bSkipFF', default => false}
+ );
# Get the timelines and make sure they match
my $strTimeline = substr($strArchiveStart, 0, 8);
@@ -803,7 +996,7 @@ sub range
if ($strTimeline ne substr($strArchiveStop, 0, 8))
{
- confess &log(ERROR, "Timelines between ${strArchiveStart} and ${strArchiveStop} differ");
+ confess &log(ERROR, "timelines differ between ${strArchiveStart} and ${strArchiveStop}");
}
# Iterate through all archive logs between start and stop
@@ -830,9 +1023,12 @@ sub range
$iArchiveIdx += 1;
}
- &log(TRACE, " archive_list_get: $strArchiveStart:$strArchiveStop (@stryArchive)");
-
- return @stryArchive;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'stryArchive', value => \@stryArchive}
+ );
}
1;
diff --git a/lib/BackRest/ArchiveInfo.pm b/lib/BackRest/ArchiveInfo.pm
index 8b8dc060d..6fcd58e69 100644
--- a/lib/BackRest/ArchiveInfo.pm
+++ b/lib/BackRest/ArchiveInfo.pm
@@ -2,7 +2,7 @@
# ARCHIVE INFO MODULE
####################################################################################################################################
package BackRest::ArchiveInfo;
-use parent 'BackRest::Ini';
+use parent 'BackRest::Common::Ini';
use strict;
use warnings FATAL => qw(all);
@@ -13,19 +13,21 @@ use File::Basename qw(dirname basename);
use File::stat;
use lib dirname($0);
+use BackRest::Common::Exception;
+use BackRest::Common::Ini;
+use BackRest::Common::Log;
use BackRest::BackupInfo;
use BackRest::Config;
-use BackRest::Exception;
use BackRest::File;
-use BackRest::Ini;
use BackRest::Manifest;
-use BackRest::Utility;
####################################################################################################################################
# Operation constants
####################################################################################################################################
use constant OP_ARCHIVE_INFO => 'ArchiveInfo';
+use constant OP_ARCHIVE_INFO_ARCHIVE_ID => OP_ARCHIVE_INFO . "->archiveId";
+use constant OP_ARCHIVE_INFO_CHECK => OP_ARCHIVE_INFO . "->check";
use constant OP_ARCHIVE_INFO_NEW => OP_ARCHIVE_INFO . "->new";
####################################################################################################################################
@@ -54,17 +56,27 @@ use constant INFO_ARCHIVE_KEY_DB_SYSTEM_ID => MANIFEST_
####################################################################################################################################
sub new
{
- my $class = shift; # Class name
- my $strArchiveClusterPath = shift; # Backup cluster path
- my $bRequired = shift; # Is archive info required?
+ my $class = shift; # Class name
- logDebug(OP_ARCHIVE_INFO_NEW, DEBUG_CALL, undef, {archiveClusterPath => \$strArchiveClusterPath});
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strArchiveClusterPath, # Backup cluster path
+ $bRequired # Is archive info required?
+ ) =
+ logDebugParam
+ (
+ OP_ARCHIVE_INFO_NEW, \@_,
+ {name => 'strArchiveClusterPath'},
+ {name => 'bRequired', default => false}
+ );
# Build the archive info path/file name
my $strArchiveInfoFile = "${strArchiveClusterPath}/" . ARCHIVE_INFO_FILE;
my $bExists = -e $strArchiveInfoFile ? true : false;
- if (!$bExists && defined($bRequired) && $bRequired)
+ if (!$bExists && $bRequired)
{
confess &log(ERROR, ARCHIVE_INFO_FILE . " does not exist but is required to get WAL segments\n" .
"HINT: Is archive_command configured in postgresql.conf?\n" .
@@ -78,7 +90,12 @@ sub new
$self->{bExists} = $bExists;
$self->{strArchiveClusterPath} = $strArchiveClusterPath;
- return $self;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'self', value => $self}
+ );
}
####################################################################################################################################
@@ -89,8 +106,20 @@ sub new
sub check
{
my $self = shift;
- my $strDbVersion = shift;
- my $ullDbSysId = shift;
+
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strDbVersion,
+ $ullDbSysId
+ ) =
+ logDebugParam
+ (
+ OP_ARCHIVE_INFO_CHECK, \@_,
+ {name => 'strDbVersion'},
+ {name => 'ullDbSysId'}
+ );
my $bSave = false;
@@ -121,12 +150,12 @@ sub check
my $iDbId = 1;
# Fill db section
- $self->setNumeric(INFO_ARCHIVE_SECTION_DB, INFO_ARCHIVE_KEY_DB_SYSTEM_ID, undef, $ullDbSysId);
+ $self->numericSet(INFO_ARCHIVE_SECTION_DB, INFO_ARCHIVE_KEY_DB_SYSTEM_ID, undef, $ullDbSysId);
$self->set(INFO_ARCHIVE_SECTION_DB, INFO_ARCHIVE_KEY_DB_VERSION, undef, $strDbVersion);
- $self->setNumeric(INFO_ARCHIVE_SECTION_DB, INFO_ARCHIVE_KEY_DB_ID, undef, $iDbId);
+ $self->numericSet(INFO_ARCHIVE_SECTION_DB, INFO_ARCHIVE_KEY_DB_ID, undef, $iDbId);
# Fill db history
- $self->setNumeric(INFO_ARCHIVE_SECTION_DB_HISTORY, $iDbId, INFO_ARCHIVE_KEY_DB_ID, $ullDbSysId);
+ $self->numericSet(INFO_ARCHIVE_SECTION_DB_HISTORY, $iDbId, INFO_ARCHIVE_KEY_DB_ID, $ullDbSysId);
$self->set(INFO_ARCHIVE_SECTION_DB_HISTORY, $iDbId, INFO_ARCHIVE_KEY_DB_VERSION, $strDbVersion);
$bSave = true;
@@ -138,7 +167,12 @@ sub check
$self->save();
}
- return $self->archiveId();
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'strArchiveId', value => $self->archiveId()}
+ );
}
@@ -151,8 +185,23 @@ sub archiveId
{
my $self = shift;
- return $self->get(INFO_ARCHIVE_SECTION_DB, INFO_ARCHIVE_KEY_DB_VERSION) . "-" .
- $self->get(INFO_ARCHIVE_SECTION_DB, INFO_ARCHIVE_KEY_DB_ID);
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation
+ ) =
+ logDebugParam
+ (
+ OP_ARCHIVE_INFO_ARCHIVE_ID
+ );
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'strArchiveId', value => $self->get(INFO_ARCHIVE_SECTION_DB, INFO_ARCHIVE_KEY_DB_VERSION) . "-" .
+ $self->get(INFO_ARCHIVE_SECTION_DB, INFO_ARCHIVE_KEY_DB_ID)}
+ );
}
1;
diff --git a/lib/BackRest/Backup.pm b/lib/BackRest/Backup.pm
index 705de637b..bc6c818b1 100644
--- a/lib/BackRest/Backup.pm
+++ b/lib/BackRest/Backup.pm
@@ -12,103 +12,170 @@ use Exporter qw(import);
use Fcntl 'SEEK_CUR';
use File::Basename;
use File::Path qw(remove_tree);
-use Scalar::Util qw(looks_like_number);
use Thread::Queue;
use lib dirname($0);
+use BackRest::Common::Exception;
+use BackRest::Common::Ini;
+use BackRest::Common::Log;
use BackRest::Archive;
use BackRest::BackupCommon;
use BackRest::BackupFile;
use BackRest::BackupInfo;
+use BackRest::Common::String;
use BackRest::Config;
use BackRest::Db;
-use BackRest::Exception;
use BackRest::File;
-use BackRest::Ini;
use BackRest::Manifest;
-use BackRest::ThreadGroup;
-use BackRest::Utility;
-
-our @EXPORT = qw(backup_init backup_cleanup backup backup_expire archive_list_get);
-
-my $oDb;
-my $oFile;
-my $strType; # Type of backup: full, differential (diff), incremental (incr)
-my $bCompress;
-my $bHardLink;
-my $bNoStartStop;
-my $bForce;
-my $iThreadMax;
-my $iThreadTimeout;
+use BackRest::Protocol::ThreadGroup;
####################################################################################################################################
-# BACKUP_INIT
+# Operation constants
####################################################################################################################################
-sub backup_init
+use constant OP_BACKUP => 'Backup';
+
+use constant OP_BACKUP_DESTROY => OP_BACKUP . '->DESTROY';
+use constant OP_BACKUP_FILE_NOT_IN_MANIFEST => OP_BACKUP . '->fileNotInManifest';
+use constant OP_BACKUP_NEW => OP_BACKUP . '->new';
+use constant OP_BACKUP_PROCESS => OP_BACKUP . '->process';
+use constant OP_BACKUP_PROCESS_MANIFEST => OP_BACKUP . '->processManifest';
+use constant OP_BACKUP_TMP_CLEAN => OP_BACKUP . '->tmpClean';
+use constant OP_BACKUP_TYPE_FIND => OP_BACKUP . '->typeFind';
+
+####################################################################################################################################
+# new
+####################################################################################################################################
+sub new
{
- my $oFileParam = shift;
- my $oDbParam = shift;
- my $strTypeParam = shift;
- my $bCompressParam = shift;
- my $bHardLinkParam = shift;
- my $iThreadMaxParam = shift;
- my $iThreadTimeoutParam = shift;
- my $bNoStartStopParam = shift;
- my $bForceParam = shift;
+ my $class = shift; # Class name
- $oFile = $oFileParam;
- $oDb = $oDbParam;
- $strType = $strTypeParam;
- $bCompress = $bCompressParam;
- $bHardLink = $bHardLinkParam;
- $iThreadMax = $iThreadMaxParam;
- $iThreadTimeout = $iThreadTimeoutParam;
- $bNoStartStop = $bNoStartStopParam;
- $bForce = $bForceParam;
+ # Create the class hash
+ my $self = {};
+ bless $self, $class;
+
+ # Assign function parameters, defaults, and log debug info
+ (
+ my $strOperation,
+ $self->{oFile}
+ ) =
+ logDebugParam
+ (
+ OP_BACKUP_NEW, \@_,
+ {name => 'oFile', trace => true}
+ );
+
+ $self->{oDb} = new BackRest::Db();
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'self', value => $self}
+ );
}
####################################################################################################################################
-# BACKUP_CLEANUP
+# DESTROY
####################################################################################################################################
-sub backup_cleanup
+sub DESTROY
{
- undef($oFile);
+ my $self = shift;
+
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation
+ ) =
+ logDebugParam
+ (
+ OP_BACKUP_DESTROY
+ );
+
+ undef($self->{oFile});
+ undef($self->{oDb});
+
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation
+ );
}
####################################################################################################################################
-# BACKUP_TYPE_FIND - Find the last backup depending on the type
+# typeFind
+#
+# Find the last backup depending on the type.
####################################################################################################################################
-sub backup_type_find
+sub typeFind
{
- my $strType = shift;
- my $strBackupClusterPath = shift;
+ my $self = shift;
- my $strDirectory;
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strType,
+ $strBackupClusterPath
+ ) =
+ logDebugParam
+ (
+ OP_BACKUP_TYPE_FIND, \@_,
+ {name => 'strType'},
+ {name => 'strBackupClusterPath'}
+ );
+
+ my $strLabel;
if ($strType eq BACKUP_TYPE_INCR)
{
- $strDirectory = ($oFile->list(PATH_BACKUP_CLUSTER, undef, backupRegExpGet(1, 1, 1), 'reverse'))[0];
+ $strLabel = ($self->{oFile}->list(PATH_BACKUP_CLUSTER, undef, backupRegExpGet(true, true, true), 'reverse'))[0];
}
- if (!defined($strDirectory) && $strType ne BACKUP_TYPE_FULL)
+ if (!defined($strLabel) && $strType ne BACKUP_TYPE_FULL)
{
- $strDirectory = ($oFile->list(PATH_BACKUP_CLUSTER, undef, backupRegExpGet(1, 0, 0), 'reverse'))[0];
+ $strLabel = ($self->{oFile}->list(PATH_BACKUP_CLUSTER, undef, backupRegExpGet(true), 'reverse'))[0];
}
- return $strDirectory;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'strLabel', value => $strLabel}
+ );
}
####################################################################################################################################
-# BACKUP_FILE_NOT_IN_MANIFEST - Find all files in a backup path that are not in the supplied manifest
+# fileNotInManifest
+#
+# Find all files in a backup path that are not in the supplied manifest.
####################################################################################################################################
-sub backup_file_not_in_manifest
+sub fileNotInManifest
{
- my $strPathType = shift;
- my $oManifest = shift;
- my $oAbortedManifest = shift;
+ my $self = shift;
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strPathType,
+ $oManifest,
+ $oAbortedManifest
+ ) =
+ logDebugParam
+ (
+ OP_BACKUP_FILE_NOT_IN_MANIFEST, \@_,
+ {name => 'strPathType', trace => true},
+ {name => 'oManifest', trace => true},
+ {name => 'oAbortedManifest', trace => true}
+ );
+
+ # Build manifest for aborted temp path
my %oFileHash;
- $oFile->manifest($strPathType, undef, \%oFileHash);
+ $self->{oFile}->manifest($strPathType, undef, \%oFileHash);
+
+ # Get compress flag
+ my $bCompressed = $oAbortedManifest->boolGet(MANIFEST_SECTION_BACKUP_OPTION, MANIFEST_KEY_COMPRESS);
my @stryFile;
@@ -177,17 +244,28 @@ sub backup_file_not_in_manifest
next;
}
}
+ # Else if a file
elsif ($cType eq 'f')
{
- if ($oManifest->test("${strSection}:file", "${strPath}") &&
+ # If the original backup was compressed the remove the extension before checking the manifest
+ if ($bCompressed)
+ {
+ $strPath = substr($strPath, 0, length($strPath) - 3);
+ }
+
+ # To be preserved the file must exist in the new manifest and not be a reference to a previous backup
+ if ($oManifest->test("${strSection}:file", $strPath) &&
!$oManifest->test("${strSection}:file", $strPath, MANIFEST_SUBKEY_REFERENCE))
{
+ # To be preserved the checksum must be defined
my $strChecksum = $oAbortedManifest->get("${strSection}:file", $strPath, MANIFEST_SUBKEY_CHECKSUM, false);
+ # The timestamp should also match and the size if the file is not compressed. If the file is compressed it's
+ # not worth extracting the size - it will be hashed later to verify its authenticity.
if (defined($strChecksum) &&
- $oManifest->getNumeric("${strSection}:file", $strPath, MANIFEST_SUBKEY_SIZE) ==
- $oFileHash{name}{$strName}{size} &&
- $oManifest->getNumeric("${strSection}:file", $strPath, MANIFEST_SUBKEY_TIMESTAMP) ==
+ ($bCompressed || ($oManifest->numericGet("${strSection}:file", $strPath, MANIFEST_SUBKEY_SIZE) ==
+ $oFileHash{name}{$strName}{size})) &&
+ $oManifest->numericGet("${strSection}:file", $strPath, MANIFEST_SUBKEY_TIMESTAMP) ==
$oFileHash{name}{$strName}{modification_time})
{
$oManifest->set("${strSection}:file", $strPath, MANIFEST_SUBKEY_CHECKSUM, $strChecksum);
@@ -200,65 +278,110 @@ sub backup_file_not_in_manifest
push @stryFile, $strName;
}
- return @stryFile;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'stryFile', value => \@stryFile}
+ );
}
####################################################################################################################################
-# BACKUP_TMP_CLEAN
+# tmpClean
#
# Cleans the temp directory from a previous failed backup so it can be reused
####################################################################################################################################
-sub backup_tmp_clean
+sub tmpClean
{
- my $oManifest = shift;
- my $oAbortedManifest = shift;
+ my $self = shift;
- &log(INFO, 'cleaning backup tmp path');
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $oManifest,
+ $oAbortedManifest
+ ) =
+ logDebugParam
+ (
+ OP_BACKUP_TMP_CLEAN, \@_,
+ {name => 'oManifest', trace => true},
+ {name => 'oAbortedManifest', trace => true}
+ );
+
+ &log(INFO, 'clean backup temp path: ' . $self->{oFile}->pathGet(PATH_BACKUP_TMP));
# Remove the pg_xlog directory since it contains nothing useful for the new backup
- if (-e $oFile->path_get(PATH_BACKUP_TMP, 'base/pg_xlog'))
+ if (-e $self->{oFile}->pathGet(PATH_BACKUP_TMP, 'base/pg_xlog'))
{
- remove_tree($oFile->path_get(PATH_BACKUP_TMP, 'base/pg_xlog')) or confess &log(ERROR, 'unable to delete tmp pg_xlog path');
+ remove_tree($self->{oFile}->pathGet(PATH_BACKUP_TMP, 'base/pg_xlog')) or confess &log(ERROR, 'unable to delete tmp pg_xlog path');
}
# Remove the pg_tblspc directory since it is trivial to rebuild, but hard to compare
- if (-e $oFile->path_get(PATH_BACKUP_TMP, 'base/pg_tblspc'))
+ if (-e $self->{oFile}->pathGet(PATH_BACKUP_TMP, 'base/pg_tblspc'))
{
- remove_tree($oFile->path_get(PATH_BACKUP_TMP, 'base/pg_tblspc')) or confess &log(ERROR, 'unable to delete tmp pg_tblspc path');
+ remove_tree($self->{oFile}->pathGet(PATH_BACKUP_TMP, 'base/pg_tblspc')) or confess &log(ERROR, 'unable to delete tmp pg_tblspc path');
}
# Get the list of files that should be deleted from temp
- my @stryFile = backup_file_not_in_manifest(PATH_BACKUP_TMP, $oManifest, $oAbortedManifest);
+ my @stryFile = $self->fileNotInManifest(PATH_BACKUP_TMP, $oManifest, $oAbortedManifest);
foreach my $strFile (sort {$b cmp $a} @stryFile)
{
- my $strDelete = $oFile->path_get(PATH_BACKUP_TMP, $strFile);
+ my $strDelete = $self->{oFile}->pathGet(PATH_BACKUP_TMP, $strFile);
# If a path then delete it, all the files should have already been deleted since we are going in reverse order
if (-d $strDelete)
{
- &log(DEBUG, "remove path ${strDelete}");
- rmdir($strDelete) or confess &log(ERROR, "unable to delete path ${strDelete}, is it empty?");
+ logDebugMisc($strOperation, "remove path ${strDelete}");
+
+ rmdir($strDelete)
+ or confess &log(ERROR, "unable to delete path ${strDelete}, is it empty?", ERROR_PATH_REMOVE);
}
# Else delete a file
else
{
- &log(DEBUG, "remove file ${strDelete}");
- unlink($strDelete) or confess &log(ERROR, "unable to delete file ${strDelete}");
+ logDebugMisc($strOperation, "remove file ${strDelete}");
+
+ unlink($strDelete)
+ or confess &log(ERROR, "unable to delete file ${strDelete}", ERROR_FILE_REMOVE);
}
}
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation
+ );
}
####################################################################################################################################
-# BACKUP_FILE - Performs the file level backup
+# processManifest
#
-# Uses the information in the manifest to determine which files need to be copied. Directories and tablespace links are only
-# created when needed, except in the case of a full backup or if hardlinks are requested.
+# Process the file level backup. Uses the information in the manifest to determine which files need to be copied. Directories
+# and tablespace links are only created when needed, except in the case of a full backup or if hardlinks are requested.
####################################################################################################################################
-sub backup_file
+sub processManifest
{
- my $strDbClusterPath = shift; # Database base data path
- my $oBackupManifest = shift; # Manifest for the current backup
+ my $self = shift;
+
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strType,
+ $bCompress,
+ $bHardLink,
+ $oBackupManifest # Manifest for the current backup
+ ) =
+ logDebugParam
+ (
+ OP_BACKUP_PROCESS_MANIFEST, \@_,
+ {name => 'strType'},
+ {name => 'bCompress'},
+ {name => 'bHardLink'},
+ {name => 'oBackupManifest'},
+ );
# Variables used for parallel copy
my %oFileCopyMap;
@@ -281,7 +404,7 @@ sub backup_file
# Create links for tablespaces
if ($oBackupManifest->test(MANIFEST_SECTION_BACKUP_PATH, $strPathKey, MANIFEST_SUBKEY_LINK) && $bFullCreate)
{
- $oFile->link_create(PATH_BACKUP_TMP, $strBackupDestinationPath,
+ $self->{oFile}->linkCreate(PATH_BACKUP_TMP, $strBackupDestinationPath,
PATH_BACKUP_TMP,
'base/pg_tblspc/' . $oBackupManifest->get(MANIFEST_SECTION_BACKUP_PATH,
$strPathKey, MANIFEST_SUBKEY_LINK),
@@ -300,7 +423,7 @@ sub backup_file
{
if ($strPath ne '.')
{
- $oFile->path_create(PATH_BACKUP_TMP, "${strBackupDestinationPath}/${strPath}");
+ $self->{oFile}->pathCreate(PATH_BACKUP_TMP, "${strBackupDestinationPath}/${strPath}");
}
}
}
@@ -315,7 +438,7 @@ sub backup_file
# Create links except in pg_tblspc because they have already been created
if (!($strPathKey eq 'base' && $strLink =~ /^pg_tblspc\/.*/))
{
- $oFile->link_create(PATH_BACKUP_ABSOLUTE,
+ $self->{oFile}->linkCreate(PATH_BACKUP_ABSOLUTE,
$oBackupManifest->get($strSectionLink, $strLink, MANIFEST_SUBKEY_DESTINATION),
PATH_BACKUP_TMP, "${strBackupDestinationPath}/${strLink}",
false, false, false);
@@ -343,14 +466,14 @@ sub backup_file
# If hardlinking is turned on then create a hardlink for files that have not changed since the last backup
if ($bHardLink)
{
- &log(DEBUG, "hardlink ${strBackupSourceFile} to ${strReference}");
+ logDebugMisc($strOperation, "hardlink ${strBackupSourceFile} to ${strReference}");
- $oFile->link_create(PATH_BACKUP_CLUSTER, "${strReference}/${strBackupDestinationPath}/${strFile}",
+ $self->{oFile}->linkCreate(PATH_BACKUP_CLUSTER, "${strReference}/${strBackupDestinationPath}/${strFile}",
PATH_BACKUP_TMP, "${strBackupDestinationPath}/${strFile}", true, false, true);
}
else
{
- &log(DEBUG, "reference ${strBackupSourceFile} to ${strReference}");
+ logDebugMisc($strOperation, "reference ${strBackupSourceFile} to ${strReference}");
}
$bProcess = false;
@@ -358,7 +481,7 @@ sub backup_file
if ($bProcess)
{
- my $lFileSize = $oBackupManifest->getNumeric($strSectionFile, $strFile, MANIFEST_SUBKEY_SIZE);
+ my $lFileSize = $oBackupManifest->numericGet($strSectionFile, $strFile, MANIFEST_SUBKEY_SIZE);
# Setup variables needed for threaded copy
$lFileTotal++;
@@ -372,7 +495,7 @@ sub backup_file
$oFileCopyMap{$strPathKey}{$strFileKey}{backup_file} = "${strBackupDestinationPath}/${strFile}";
$oFileCopyMap{$strPathKey}{$strFileKey}{size} = $lFileSize;
$oFileCopyMap{$strPathKey}{$strFileKey}{modification_time} =
- $oBackupManifest->getNumeric($strSectionFile, $strFile, MANIFEST_SUBKEY_TIMESTAMP, false);
+ $oBackupManifest->numericGet($strSectionFile, $strFile, MANIFEST_SUBKEY_TIMESTAMP, false);
$oFileCopyMap{$strPathKey}{$strFileKey}{checksum} =
$oBackupManifest->get($strSectionFile, $strFile, MANIFEST_SUBKEY_CHECKSUM, false);
}
@@ -387,137 +510,146 @@ sub backup_file
{
confess &log(ERROR, "no files have changed since the last backup - this seems unlikely");
}
-
- return;
}
-
- # Create backup and result queues
- my $oResultQueue = Thread::Queue->new();
- my @oyBackupQueue;
-
- # Variables used for local copy
- my $lSizeCurrent = 0; # Running total of bytes copied
- my $bCopied; # Was the file copied?
- my $lCopySize; # Size reported by copy
- my $strCopyChecksum; # Checksum reported by copy
-
- # Determine how often the manifest will be saved
- my $lManifestSaveCurrent = 0;
- my $lManifestSaveSize = int($lSizeTotal / 100);
-
- if ($lManifestSaveSize < optionGet(OPTION_MANIFEST_SAVE_THRESHOLD))
+ else
{
- $lManifestSaveSize = optionGet(OPTION_MANIFEST_SAVE_THRESHOLD);
- }
+ # Create backup and result queues
+ my $oResultQueue = Thread::Queue->new();
+ my @oyBackupQueue;
- # Iterate all backup files
- foreach my $strPathKey (sort (keys %oFileCopyMap))
- {
- if ($iThreadMax > 1)
+ # Variables used for local copy
+ my $lSizeCurrent = 0; # Running total of bytes copied
+ my $bCopied; # Was the file copied?
+ my $lCopySize; # Size reported by copy
+ my $strCopyChecksum; # Checksum reported by copy
+
+ # Determine how often the manifest will be saved
+ my $lManifestSaveCurrent = 0;
+ my $lManifestSaveSize = int($lSizeTotal / 100);
+
+ if ($lManifestSaveSize < optionGet(OPTION_MANIFEST_SAVE_THRESHOLD))
{
- $oyBackupQueue[@oyBackupQueue] = Thread::Queue->new();
+ $lManifestSaveSize = optionGet(OPTION_MANIFEST_SAVE_THRESHOLD);
}
- foreach my $strFileKey (sort {$b cmp $a} (keys(%{$oFileCopyMap{$strPathKey}})))
+ # Iterate all backup files
+ foreach my $strPathKey (sort (keys %oFileCopyMap))
{
- my $oFileCopy = $oFileCopyMap{$strPathKey}{$strFileKey};
-
- if ($iThreadMax > 1)
+ if (optionGet(OPTION_THREAD_MAX) > 1)
{
- $oyBackupQueue[@oyBackupQueue - 1]->enqueue($oFileCopy);
+ $oyBackupQueue[@oyBackupQueue] = Thread::Queue->new();
}
- else
- {
- # Backup the file
- ($bCopied, $lSizeCurrent, $lCopySize, $strCopyChecksum) =
- backupFile($oFile, $$oFileCopy{db_file}, $$oFileCopy{backup_file}, $bCompress,
- $$oFileCopy{checksum}, $$oFileCopy{modification_time},
- $$oFileCopy{size}, $lSizeTotal, $lSizeCurrent);
- $lManifestSaveCurrent = backupManifestUpdate($oBackupManifest, $$oFileCopy{file_section}, $$oFileCopy{file},
- $bCopied, $lCopySize, $strCopyChecksum, $lManifestSaveSize,
- $lManifestSaveCurrent);
+ foreach my $strFileKey (sort {$b cmp $a} (keys(%{$oFileCopyMap{$strPathKey}})))
+ {
+ my $oFileCopy = $oFileCopyMap{$strPathKey}{$strFileKey};
+
+ if (optionGet(OPTION_THREAD_MAX) > 1)
+ {
+ $oyBackupQueue[@oyBackupQueue - 1]->enqueue($oFileCopy);
+ }
+ else
+ {
+ # Backup the file
+ ($bCopied, $lSizeCurrent, $lCopySize, $strCopyChecksum) =
+ backupFile($self->{oFile}, $$oFileCopy{db_file}, $$oFileCopy{backup_file}, $bCompress,
+ $$oFileCopy{checksum}, $$oFileCopy{modification_time},
+ $$oFileCopy{size}, $lSizeTotal, $lSizeCurrent);
+
+ $lManifestSaveCurrent = backupManifestUpdate($oBackupManifest, $$oFileCopy{file_section}, $$oFileCopy{file},
+ $bCopied, $lCopySize, $strCopyChecksum, $lManifestSaveSize,
+ $lManifestSaveCurrent);
+ }
}
}
- }
- # If multi-threaded then create threads to copy files
- if ($iThreadMax > 1)
- {
- for (my $iThreadIdx = 0; $iThreadIdx < $iThreadMax; $iThreadIdx++)
+ # If multi-threaded then create threads to copy files
+ if (optionGet(OPTION_THREAD_MAX) > 1)
{
- my %oParam;
-
- $oParam{compress} = $bCompress;
- $oParam{size_total} = $lSizeTotal;
- $oParam{queue} = \@oyBackupQueue;
- $oParam{result_queue} = $oResultQueue;
-
- threadGroupRun($iThreadIdx, 'backup', \%oParam);
- }
-
- # Complete thread queues
- my $bDone = false;
-
- do
- {
- $bDone = threadGroupComplete();
-
- # Read the messages that are passed back from the backup threads
- while (my $oMessage = $oResultQueue->dequeue_nb())
+ for (my $iThreadIdx = 0; $iThreadIdx < optionGet(OPTION_THREAD_MAX); $iThreadIdx++)
{
- &log(TRACE, "message received in master queue: section = $$oMessage{file_section}, file = $$oMessage{file}" .
- ", copied = $$oMessage{copied}");
+ my %oParam;
- $lManifestSaveCurrent = backupManifestUpdate($oBackupManifest, $$oMessage{file_section}, $$oMessage{file},
- $$oMessage{copied}, $$oMessage{size}, $$oMessage{checksum},
- $lManifestSaveSize, $lManifestSaveCurrent);
+ $oParam{compress} = $bCompress;
+ $oParam{size_total} = $lSizeTotal;
+ $oParam{queue} = \@oyBackupQueue;
+ $oParam{result_queue} = $oResultQueue;
+
+ threadGroupRun($iThreadIdx, 'backup', \%oParam);
}
+
+ # Complete thread queues
+ my $bDone = false;
+
+ do
+ {
+ $bDone = threadGroupComplete();
+
+ # Read the messages that are passed back from the backup threads
+ while (my $oMessage = $oResultQueue->dequeue_nb())
+ {
+ &log(TRACE, "message received in master queue: section = $$oMessage{file_section}, file = $$oMessage{file}" .
+ ", copied = $$oMessage{copied}");
+
+ $lManifestSaveCurrent = backupManifestUpdate($oBackupManifest, $$oMessage{file_section}, $$oMessage{file},
+ $$oMessage{copied}, $$oMessage{size}, $$oMessage{checksum},
+ $lManifestSaveSize, $lManifestSaveCurrent);
+ }
+ }
+ while (!$bDone);
}
- while (!$bDone);
}
- &log(INFO, 'total backup size: ' . file_size_format($lSizeTotal));
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'lSizeTotal', value => $lSizeTotal}
+ );
}
####################################################################################################################################
-# BACKUP
+# process
#
-# Performs the entire database backup.
+# Process the database backup.
####################################################################################################################################
-sub backup
+sub process
{
- my $strDbClusterPath = shift;
- my $bStartFast = shift;
+ my $self = shift;
+
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation
+ ) =
+ logDebugParam
+ (
+ OP_BACKUP_PROCESS
+ );
# Record timestamp start
my $lTimestampStart = time();
- # Backup start
- &log(INFO, "backup start: type = ${strType}");
+ # Store local type, compress, and hardlink options since they can be modified by the process
+ my $strType = optionGet(OPTION_TYPE);
+ my $bCompress = optionGet(OPTION_COMPRESS);
+ my $bHardLink = optionGet(OPTION_HARDLINK);
# Not supporting remote backup hosts yet
- if ($oFile->is_remote(PATH_BACKUP))
+ if ($self->{oFile}->isRemote(PATH_BACKUP))
{
confess &log(ERROR, 'remote backup host not currently supported');
}
- if (!defined($strDbClusterPath))
- {
- confess &log(ERROR, 'cluster data path is not defined');
- }
-
- &log(DEBUG, "cluster path is $strDbClusterPath");
-
# Create the cluster backup path
- $oFile->path_create(PATH_BACKUP_CLUSTER, undef, undef, true);
+ $self->{oFile}->pathCreate(PATH_BACKUP_CLUSTER, undef, undef, true);
# Load or build backup.info
- my $oBackupInfo = new BackRest::BackupInfo($oFile->path_get(PATH_BACKUP_CLUSTER));
+ my $oBackupInfo = new BackRest::BackupInfo($self->{oFile}->pathGet(PATH_BACKUP_CLUSTER));
# Build backup tmp and config
- my $strBackupTmpPath = $oFile->path_get(PATH_BACKUP_TMP);
- my $strBackupConfFile = $oFile->path_get(PATH_BACKUP_TMP, 'backup.manifest');
+ my $strBackupTmpPath = $self->{oFile}->pathGet(PATH_BACKUP_TMP);
+ my $strBackupConfFile = $self->{oFile}->pathGet(PATH_BACKUP_TMP, 'backup.manifest');
# Declare the backup manifest
my $oBackupManifest = new BackRest::Manifest($strBackupConfFile, false);
@@ -525,24 +657,42 @@ sub backup
# Find the previous backup based on the type
my $oLastManifest = undef;
- my $strBackupLastPath = backup_type_find($strType, $oFile->path_get(PATH_BACKUP_CLUSTER));
+ my $strBackupLastPath = $self->typeFind($strType, $self->{oFile}->pathGet(PATH_BACKUP_CLUSTER));
if (defined($strBackupLastPath))
{
- $oLastManifest = new BackRest::Manifest($oFile->path_get(PATH_BACKUP_CLUSTER) . "/${strBackupLastPath}/backup.manifest");
+ $oLastManifest = new BackRest::Manifest($self->{oFile}->pathGet(PATH_BACKUP_CLUSTER) . "/${strBackupLastPath}/backup.manifest");
&log(INFO, 'last backup label = ' . $oLastManifest->get(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_LABEL) .
', version = ' . $oLastManifest->get(INI_SECTION_BACKREST, INI_KEY_VERSION));
+
+ # If this is incr or diff warn if certain options have changed
+ if ($strType ne BACKUP_TYPE_FULL)
+ {
+ my $strKey;
+
+ # Warn if compress option changed
+ if (!$oLastManifest->boolTest(MANIFEST_SECTION_BACKUP_OPTION, MANIFEST_KEY_COMPRESS, undef, $bCompress))
+ {
+ &log(WARN, "${strType} backup cannot alter compress option to '" . boolFormat($bCompress) .
+ "', reset to value in ${strBackupLastPath}");
+ $bCompress = $oLastManifest->boolGet(MANIFEST_SECTION_BACKUP_OPTION, MANIFEST_KEY_COMPRESS);
+ }
+
+ # Warn if hardlink option changed
+ if (!$oLastManifest->boolTest(MANIFEST_SECTION_BACKUP_OPTION, MANIFEST_KEY_HARDLINK, undef, $bHardLink))
+ {
+ &log(WARN, "${strType} backup cannot alter hardlink option to '" . boolFormat($bHardLink) .
+ "', reset to value in ${strBackupLastPath}");
+ $bHardLink = $oLastManifest->boolGet(MANIFEST_SECTION_BACKUP_OPTION, MANIFEST_KEY_HARDLINK);
+ }
+ }
}
else
{
- if ($strType eq BACKUP_TYPE_DIFF)
+ if ($strType eq BACKUP_TYPE_DIFF || $strType eq BACKUP_TYPE_INCR)
{
- &log(WARN, 'No full backup exists, differential backup has been changed to full');
- }
- elsif ($strType eq BACKUP_TYPE_INCR)
- {
- &log(WARN, 'No prior backup exists, incremental backup has been changed to full');
+ &log(WARN, "no prior backup exists, ${strType} backup has been changed to full");
}
$strType = BACKUP_TYPE_FULL;
@@ -550,33 +700,36 @@ sub backup
# Backup settings
$oBackupManifest->set(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_TYPE, undef, $strType);
- $oBackupManifest->setNumeric(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_TIMESTAMP_START, undef, $lTimestampStart);
- $oBackupManifest->setBool(MANIFEST_SECTION_BACKUP_OPTION, MANIFEST_KEY_COMPRESS, undef, $bCompress);
- $oBackupManifest->setBool(MANIFEST_SECTION_BACKUP_OPTION, MANIFEST_KEY_HARDLINK, undef, $bHardLink);
- $oBackupManifest->setBool(MANIFEST_SECTION_BACKUP_OPTION, MANIFEST_KEY_START_STOP, undef, !$bNoStartStop);
- $oBackupManifest->setBool(MANIFEST_SECTION_BACKUP_OPTION, MANIFEST_KEY_ARCHIVE_COPY, undef,
- $bNoStartStop || optionGet(OPTION_BACKUP_ARCHIVE_COPY));
- $oBackupManifest->setBool(MANIFEST_SECTION_BACKUP_OPTION, MANIFEST_KEY_ARCHIVE_CHECK, undef,
- $bNoStartStop || optionGet(OPTION_BACKUP_ARCHIVE_CHECK));
+ $oBackupManifest->numericSet(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_TIMESTAMP_START, undef, $lTimestampStart);
+ $oBackupManifest->boolSet(MANIFEST_SECTION_BACKUP_OPTION, MANIFEST_KEY_COMPRESS, undef, $bCompress);
+ $oBackupManifest->boolSet(MANIFEST_SECTION_BACKUP_OPTION, MANIFEST_KEY_HARDLINK, undef, $bHardLink);
+ $oBackupManifest->boolSet(MANIFEST_SECTION_BACKUP_OPTION, MANIFEST_KEY_START_STOP, undef, !optionGet(OPTION_NO_START_STOP));
+ $oBackupManifest->boolSet(MANIFEST_SECTION_BACKUP_OPTION, MANIFEST_KEY_ARCHIVE_COPY, undef,
+ optionGet(OPTION_NO_START_STOP) || optionGet(OPTION_BACKUP_ARCHIVE_COPY));
+ $oBackupManifest->boolSet(MANIFEST_SECTION_BACKUP_OPTION, MANIFEST_KEY_ARCHIVE_CHECK, undef,
+ optionGet(OPTION_NO_START_STOP) || optionGet(OPTION_BACKUP_ARCHIVE_CHECK));
# Database info
- my ($fDbVersion, $iControlVersion, $iCatalogVersion, $ullDbSysId) = $oDb->info($oFile, $strDbClusterPath);
+ my ($fDbVersion, $iControlVersion, $iCatalogVersion, $ullDbSysId) =
+ $self->{oDb}->info($self->{oFile}, optionGet(OPTION_DB_PATH));
$oBackupManifest->set(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_DB_VERSION, undef, $fDbVersion);
- $oBackupManifest->setNumeric(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_CONTROL, undef, $iControlVersion);
- $oBackupManifest->setNumeric(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_CATALOG, undef, $iCatalogVersion);
- $oBackupManifest->setNumeric(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_SYSTEM_ID, undef, $ullDbSysId);
+ $oBackupManifest->numericSet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_CONTROL, undef, $iControlVersion);
+ $oBackupManifest->numericSet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_CATALOG, undef, $iCatalogVersion);
+ $oBackupManifest->numericSet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_SYSTEM_ID, undef, $ullDbSysId);
$oBackupInfo->check($oBackupManifest);
# Start backup (unless no-start-stop is set)
my $strArchiveStart;
+ my $oTablespaceMap;
- if ($bNoStartStop)
+ # Don't start the backup but do check if PostgreSQL is running
+ if (optionGet(OPTION_NO_START_STOP))
{
- if ($oFile->exists(PATH_DB_ABSOLUTE, $strDbClusterPath . '/' . FILE_POSTMASTER_PID))
+ if ($self->{oFile}->exists(PATH_DB_ABSOLUTE, optionGet(OPTION_DB_PATH) . '/' . FILE_POSTMASTER_PID))
{
- if ($bForce)
+ if (optionGet(OPTION_FORCE))
{
&log(WARN, '--no-start-stop passed and ' . FILE_POSTMASTER_PID . ' exists but --force was passed so backup will ' .
'continue though it looks like the postmaster is running and the backup will probably not be ' .
@@ -590,130 +743,155 @@ sub backup
}
}
}
+ # Else start the backup normally
else
{
my $strTimestampDbStart;
+ # Start the backup
($strArchiveStart, $strTimestampDbStart) =
- $oDb->backupStart($oFile, $strDbClusterPath, BACKREST_EXE . ' backup started ' .
- timestamp_string_get(undef, $lTimestampStart), $bStartFast);
+ $self->{oDb}->backupStart($self->{oFile}, optionGet(OPTION_DB_PATH), BACKREST_EXE . ' backup started ' .
+ timestampFormat(undef, $lTimestampStart), optionGet(OPTION_START_FAST));
+ # Record the archive start location
$oBackupManifest->set(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_ARCHIVE_START, undef, $strArchiveStart);
&log(INFO, "archive start: ${strArchiveStart}");
+
+ # Build the backup manifest
+ $oTablespaceMap = optionGet(OPTION_NO_START_STOP) ? undef : $self->{oDb}->tablespaceMapGet();
}
- # Build the backup manifest
- my $oTablespaceMap = $bNoStartStop ? undef : $oDb->tablespaceMapGet();
-
- $oBackupManifest->build($oFile, $strDbClusterPath, $oLastManifest, $bNoStartStop, $oTablespaceMap);
+ # Buid the manifest
+ $oBackupManifest->build($self->{oFile}, optionGet(OPTION_DB_PATH), $oLastManifest, optionGet(OPTION_NO_START_STOP),
+ $oTablespaceMap);
&log(TEST, TEST_MANIFEST_BUILD);
# Check if an aborted backup exists for this stanza
if (-e $strBackupTmpPath)
{
my $bUsable = false;
-
- my $strType = $oBackupManifest->get(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_TYPE);
- my $strPrior = $oBackupManifest->get(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_PRIOR, undef, false, '');
- my $strVersion = $oBackupManifest->get(INI_SECTION_BACKREST, INI_KEY_VERSION);
-
- my $strAbortedType = '';
- my $strAbortedPrior = '';
- my $strAbortedVersion = '';
+ my $strReason = "resume is disabled";
my $oAbortedManifest;
- # Attempt to read the manifest file in the aborted backup to see if the backup type and prior backup are the same as the
- # new backup that is being started. If any error at all occurs then the backup will be considered unusable and a resume
- # will not be attempted.
- eval
+ # Attempt to read the manifest file in the aborted backup to seeif it can be used. If any error at all occurs then the
+ # backup will be considered unusable and a resume will not be attempted.
+ if (optionGet(OPTION_RESUME))
{
- # Load the aborted manifest
- $oAbortedManifest = new BackRest::Manifest("${strBackupTmpPath}/backup.manifest");
+ $strReason = "unable to read ${strBackupTmpPath}/backup.manifest";
- # Default values if they are not set
- $strAbortedType = $oAbortedManifest->get(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_TYPE);
- $strAbortedPrior = $oAbortedManifest->get(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_PRIOR, undef, false, '');
- $strAbortedVersion = $oAbortedManifest->get(INI_SECTION_BACKREST, INI_KEY_VERSION);
-
- # The backup is usable if between the current backup and the aborted backup:
- # 1) The version matches
- # 2) The type of both is full or the types match and prior matches
- if ($strAbortedVersion eq $strVersion)
+ eval
{
- if ($strAbortedType eq BACKUP_TYPE_FULL
- && $oBackupManifest->get(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_TYPE) eq BACKUP_TYPE_FULL)
+ # Load the aborted manifest
+ $oAbortedManifest = new BackRest::Manifest("${strBackupTmpPath}/backup.manifest");
+
+ # Key and values that do not match
+ my $strKey;
+ my $strValueNew;
+ my $strValueAborted;
+
+ # Check version
+ if ($oBackupManifest->get(INI_SECTION_BACKREST, INI_KEY_VERSION) ne
+ $oAbortedManifest->get(INI_SECTION_BACKREST, INI_KEY_VERSION))
+ {
+ $strKey = INI_KEY_VERSION;
+ $strValueNew = $oBackupManifest->get(INI_SECTION_BACKREST, INI_KEY_VERSION);
+ $strValueAborted = $oAbortedManifest->get(INI_SECTION_BACKREST, INI_KEY_VERSION);
+ }
+ # Check format
+ elsif ($oBackupManifest->get(INI_SECTION_BACKREST, INI_KEY_FORMAT) ne
+ $oAbortedManifest->get(INI_SECTION_BACKREST, INI_KEY_FORMAT))
+ {
+ $strKey = INI_KEY_FORMAT;
+ $strValueNew = $oBackupManifest->get(INI_SECTION_BACKREST, INI_KEY_FORMAT);
+ $strValueAborted = $oAbortedManifest->get(INI_SECTION_BACKREST, INI_KEY_FORMAT);
+ }
+ # Check backup type
+ elsif ($oBackupManifest->get(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_TYPE) ne
+ $oAbortedManifest->get(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_TYPE))
+ {
+ $strKey = MANIFEST_KEY_TYPE;
+ $strValueNew = $oBackupManifest->get(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_TYPE);
+ $strValueAborted = $oAbortedManifest->get(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_TYPE);
+ }
+ # Check prior label
+ elsif ($oBackupManifest->get(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_PRIOR, undef, false, '') ne
+ $oAbortedManifest->get(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_PRIOR, undef, false, ''))
+ {
+ $strKey = MANIFEST_KEY_PRIOR;
+ $strValueNew = $oBackupManifest->get(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_PRIOR, undef, false, '');
+ $strValueAborted = $oAbortedManifest->get(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_PRIOR, undef, false, '');
+ }
+ # Check compression
+ elsif ($oBackupManifest->boolGet(MANIFEST_SECTION_BACKUP_OPTION, MANIFEST_KEY_COMPRESS) ne
+ $oAbortedManifest->boolGet(MANIFEST_SECTION_BACKUP_OPTION, MANIFEST_KEY_COMPRESS))
+ {
+ $strKey = MANIFEST_KEY_COMPRESS;
+ $strValueNew = $oBackupManifest->boolGet(MANIFEST_SECTION_BACKUP_OPTION, MANIFEST_KEY_COMPRESS);
+ $strValueAborted = $oAbortedManifest->boolGet(MANIFEST_SECTION_BACKUP_OPTION, MANIFEST_KEY_COMPRESS);
+ }
+ # Check hardlink
+ elsif ($oBackupManifest->boolGet(MANIFEST_SECTION_BACKUP_OPTION, MANIFEST_KEY_HARDLINK) ne
+ $oAbortedManifest->boolGet(MANIFEST_SECTION_BACKUP_OPTION, MANIFEST_KEY_HARDLINK))
+ {
+ $strKey = MANIFEST_KEY_HARDLINK;
+ $strValueNew = $oBackupManifest->boolGet(MANIFEST_SECTION_BACKUP_OPTION, MANIFEST_KEY_HARDLINK);
+ $strValueAborted = $oAbortedManifest->boolGet(MANIFEST_SECTION_BACKUP_OPTION, MANIFEST_KEY_HARDLINK);
+ }
+
+ # If key is defined then something didn't match
+ if (defined($strKey))
+ {
+ $strReason = "new ${strKey} '${strValueNew}' does not match aborted ${strKey} '${strValueAborted}'";
+ }
+ # Else the backup can be resumed
+ else
{
$bUsable = true;
}
- elsif ($strAbortedType eq $oBackupManifest->get(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_TYPE) &&
- $strAbortedPrior eq $oBackupManifest->get(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_PRIOR))
- {
- $bUsable = true;
- }
- }
- };
+ };
+ }
# If the aborted backup is usable then clean it
- if ($bUsable && optionGet(OPTION_RESUME))
+ if ($bUsable)
{
&log(WARN, 'aborted backup of same type exists, will be cleaned to remove invalid files and resumed');
&log(TEST, TEST_BACKUP_RESUME);
# Clean the old backup tmp path
- backup_tmp_clean($oBackupManifest, $oAbortedManifest);
+ $self->tmpClean($oBackupManifest, $oAbortedManifest);
}
# Else remove it
else
{
- my $strReason = "resume is disabled";
-
- if (optionGet(OPTION_RESUME))
- {
- if ($strVersion eq $strAbortedVersion)
- {
- if ($strType ne $strAbortedType)
- {
- $strReason = "new type '${strType}' does not match aborted type '${strAbortedType}'";
- }
- else
- {
- $strReason = "new prior '${strPrior}' does not match aborted prior '${strAbortedPrior}'";
- }
- }
- else
- {
- $strReason = "new version '${strVersion}' does not match aborted version '${strVersion}'";
- }
- }
-
&log(WARN, "aborted backup exists, but cannot be resumed (${strReason}) - will be dropped and recreated");
&log(TEST, TEST_BACKUP_NORESUME);
- remove_tree($oFile->path_get(PATH_BACKUP_TMP))
+ remove_tree($self->{oFile}->pathGet(PATH_BACKUP_TMP))
or confess &log(ERROR, "unable to delete tmp path: ${strBackupTmpPath}");
- $oFile->path_create(PATH_BACKUP_TMP);
+ $self->{oFile}->pathCreate(PATH_BACKUP_TMP);
}
}
# Else create the backup tmp path
else
{
- &log(DEBUG, "creating backup path ${strBackupTmpPath}");
- $oFile->path_create(PATH_BACKUP_TMP);
+ logDebugMisc($strOperation, "create temp backup path ${strBackupTmpPath}");
+ $self->{oFile}->pathCreate(PATH_BACKUP_TMP);
}
# Save the backup manifest
$oBackupManifest->save();
# Perform the backup
- backup_file($strDbClusterPath, $oBackupManifest);
+ my $lBackupSizeTotal = $self->processManifest($strType, $bCompress, $bHardLink, $oBackupManifest);
+ &log(INFO, "${strType} backup size = " . fileSizeFormat($lBackupSizeTotal));
# Stop backup (unless no-start-stop is set)
my $strArchiveStop;
- if (!$bNoStartStop)
+ if (!optionGet(OPTION_NO_START_STOP))
{
my $strTimestampDbStop;
- ($strArchiveStop, $strTimestampDbStop) = $oDb->backupStop();
+ ($strArchiveStop, $strTimestampDbStop) = $self->{oDb}->backupStop();
$oBackupManifest->set(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_ARCHIVE_STOP, undef, $strArchiveStop);
@@ -732,25 +910,25 @@ sub backup
my $lModificationTime = time();
# After the backup has been stopped, need to make a copy of the archive logs need to make the db consistent
- &log(DEBUG, "retrieving archive logs ${strArchiveStart}:${strArchiveStop}");
+ logDebugMisc($strOperation, "retrieve archive logs ${strArchiveStart}:${strArchiveStop}");
my $oArchive = new BackRest::Archive();
- my $strArchiveId = $oArchive->getCheck($oFile);
+ my $strArchiveId = $oArchive->getCheck($self->{oFile});
my @stryArchive = $oArchive->range($strArchiveStart, $strArchiveStop, $fDbVersion < 9.3);
foreach my $strArchive (@stryArchive)
{
- my $strArchiveFile = $oArchive->walFileName($oFile, $strArchiveId, $strArchive, 600);
+ my $strArchiveFile = $oArchive->walFileName($self->{oFile}, $strArchiveId, $strArchive, 600);
if (optionGet(OPTION_BACKUP_ARCHIVE_COPY))
{
- &log(DEBUG, "archiving: ${strArchive} (${strArchiveFile})");
+ logDebugMisc($strOperation, "archive: ${strArchive} (${strArchiveFile})");
# Copy the log file from the archive repo to the backup
- my $strDestinationFile = "base/pg_xlog/${strArchive}" . ($bCompress ? ".$oFile->{strCompressExtension}" : '');
- my $bArchiveCompressed = $strArchiveFile =~ "^.*\.$oFile->{strCompressExtension}\$";
+ my $strDestinationFile = "base/pg_xlog/${strArchive}" . ($bCompress ? ".$self->{oFile}->{strCompressExtension}" : '');
+ my $bArchiveCompressed = $strArchiveFile =~ "^.*\.$self->{oFile}->{strCompressExtension}\$";
my ($bCopyResult, $strCopyChecksum, $lCopySize) =
- $oFile->copy(PATH_BACKUP_ARCHIVE, "${strArchiveId}/${strArchiveFile}",
+ $self->{oFile}->copy(PATH_BACKUP_ARCHIVE, "${strArchiveId}/${strArchiveFile}",
PATH_BACKUP_TMP, $strDestinationFile,
$bArchiveCompressed, $bCompress,
undef, $lModificationTime, undef, true);
@@ -762,7 +940,7 @@ sub backup
my $strFileLog = "pg_xlog/${strArchive}";
# Compare the checksum against the one already in the archive log name
- if ($strArchiveFile !~ "^${strArchive}-${strCopyChecksum}(\\.$oFile->{strCompressExtension}){0,1}\$")
+ if ($strArchiveFile !~ "^${strArchive}-${strCopyChecksum}(\\.$self->{oFile}->{strCompressExtension}){0,1}\$")
{
confess &log(ERROR, "error copying WAL segment '${strArchiveFile}' to backup - checksum recorded with " .
"file does not match actual checksum of '${strCopyChecksum}'", ERROR_CHECKSUM);
@@ -787,14 +965,14 @@ sub backup
if ($strType eq BACKUP_TYPE_FULL || !defined($strBackupLastPath))
{
- $strBackupPath = timestamp_file_string_get() . 'F';
+ $strBackupPath = timestampFileFormat() . 'F';
$strType = BACKUP_TYPE_FULL;
}
else
{
$strBackupPath = substr($strBackupLastPath, 0, 16);
- $strBackupPath .= '_' . timestamp_file_string_get(undef, $lTimestampStop);
+ $strBackupPath .= '_' . timestampFileFormat(undef, $lTimestampStop);
if ($strType eq BACKUP_TYPE_DIFF)
{
@@ -813,233 +991,24 @@ sub backup
# Save the backup manifest final time
$oBackupManifest->save();
- &log(INFO, "new backup label: ${strBackupPath}");
+ &log(INFO, "new backup label = ${strBackupPath}");
# Rename the backup tmp path to complete the backup
- &log(DEBUG, "moving ${strBackupTmpPath} to " . $oFile->path_get(PATH_BACKUP_CLUSTER, $strBackupPath));
- $oFile->move(PATH_BACKUP_TMP, undef, PATH_BACKUP_CLUSTER, $strBackupPath);
+ logDebugMisc($strOperation, "move ${strBackupTmpPath} to " . $self->{oFile}->pathGet(PATH_BACKUP_CLUSTER, $strBackupPath));
+ $self->{oFile}->move(PATH_BACKUP_TMP, undef, PATH_BACKUP_CLUSTER, $strBackupPath);
# Create a link to the most recent backup
- $oFile->remove(PATH_BACKUP_CLUSTER, "latest");
- $oFile->link_create(PATH_BACKUP_CLUSTER, $strBackupPath, PATH_BACKUP_CLUSTER, "latest", undef, true);
+ $self->{oFile}->remove(PATH_BACKUP_CLUSTER, "latest");
+ $self->{oFile}->linkCreate(PATH_BACKUP_CLUSTER, $strBackupPath, PATH_BACKUP_CLUSTER, "latest", undef, true);
# Save backup info
- $oBackupInfo->backupAdd($oFile, $oBackupManifest);
+ $oBackupInfo->add($self->{oFile}, $oBackupManifest);
- # Backup stop
- &log(INFO, 'backup stop');
-}
-
-####################################################################################################################################
-# BACKUP_EXPIRE
-#
-# Removes expired backups and archive logs from the backup directory. Partial backups are not counted for expiration, so if full
-# or differential retention is set to 2, there must be three complete backups before the oldest one can be deleted.
-#
-# iFullRetention - Optional, must be greater than 0 when supplied.
-# iDifferentialRetention - Optional, must be greater than 0 when supplied.
-# strArchiveRetention - Optional, must be (full,differential/diff,incremental/incr) when supplied
-# iArchiveRetention - Required when strArchiveRetention is supplied. Must be greater than 0.
-####################################################################################################################################
-sub backup_expire
-{
- my $strBackupClusterPath = shift; # Base path to cluster backup
- my $iFullRetention = shift; # Number of full backups to keep
- my $iDifferentialRetention = shift; # Number of differential backups to keep
- my $strArchiveRetentionType = shift; # Type of backup to base archive retention on
- my $iArchiveRetention = shift; # Number of backups worth of archive to keep
-
- my $strPath;
- my @stryPath;
-
- # Load or build backup.info
- my $oBackupInfo = new BackRest::BackupInfo($oFile->path_get(PATH_BACKUP_CLUSTER));
-
- # Find all the expired full backups
- if (defined($iFullRetention))
- {
- # Make sure iFullRetention is valid
- if (!looks_like_number($iFullRetention) || $iFullRetention < 1)
- {
- confess &log(ERROR, 'full_rentention must be a number >= 1');
- }
-
- my $iIndex = $iFullRetention;
- @stryPath = $oFile->list(PATH_BACKUP_CLUSTER, undef, backupRegExpGet(1, 0, 0), 'reverse');
-
- while (defined($stryPath[$iIndex]))
- {
- # Delete all backups that depend on the full backup. Done in reverse order so that remaining backups will still
- # be consistent if the process dies
- foreach $strPath ($oFile->list(PATH_BACKUP_CLUSTER, undef, '^' . $stryPath[$iIndex] . '.*', 'reverse'))
- {
- system("rm -rf ${strBackupClusterPath}/${strPath}") == 0
- or confess &log(ERROR, "unable to delete backup ${strPath}");
-
- $oBackupInfo->backupRemove($strPath);
- }
-
- &log(INFO, 'remove expired full backup: ' . $stryPath[$iIndex]);
-
- $iIndex++;
- }
- }
-
- # Find all the expired differential backups
- if (defined($iDifferentialRetention))
- {
- # Make sure iDifferentialRetention is valid
- if (!looks_like_number($iDifferentialRetention) || $iDifferentialRetention < 1)
- {
- confess &log(ERROR, 'differential_rentention must be a number >= 1');
- }
-
- @stryPath = $oFile->list(PATH_BACKUP_CLUSTER, undef, backupRegExpGet(0, 1, 0), 'reverse');
-
- if (defined($stryPath[$iDifferentialRetention - 1]))
- {
- &log(DEBUG, 'differential expiration based on ' . $stryPath[$iDifferentialRetention - 1]);
-
- # Get a list of all differential and incremental backups
- foreach $strPath ($oFile->list(PATH_BACKUP_CLUSTER, undef, backupRegExpGet(0, 1, 1), 'reverse'))
- {
- &log(DEBUG, "checking ${strPath} for differential expiration");
-
- # Remove all differential and incremental backups before the oldest valid differential
- if ($strPath lt $stryPath[$iDifferentialRetention - 1])
- {
- system("rm -rf ${strBackupClusterPath}/${strPath}") == 0
- or confess &log(ERROR, "unable to delete backup ${strPath}");
- $oBackupInfo->backupRemove($strPath);
-
- &log(INFO, "remove expired diff/incr backup ${strPath}");
- }
- }
- }
- }
-
- # If no archive retention type is set then exit
- if (!defined($strArchiveRetentionType))
- {
- &log(INFO, 'archive rentention type not set - archive logs will not be expired');
- return;
- }
-
- # Determine which backup type to use for archive retention (full, differential, incremental)
- if ($strArchiveRetentionType eq BACKUP_TYPE_FULL)
- {
- if (!defined($iArchiveRetention))
- {
- $iArchiveRetention = $iFullRetention;
- }
-
- @stryPath = $oFile->list(PATH_BACKUP_CLUSTER, undef, backupRegExpGet(1, 0, 0), 'reverse');
- }
- elsif ($strArchiveRetentionType eq BACKUP_TYPE_DIFF)
- {
- if (!defined($iArchiveRetention))
- {
- $iArchiveRetention = $iDifferentialRetention;
- }
-
- @stryPath = $oFile->list(PATH_BACKUP_CLUSTER, undef, backupRegExpGet(1, 1, 0), 'reverse');
- }
- elsif ($strArchiveRetentionType eq BACKUP_TYPE_INCR)
- {
- @stryPath = $oFile->list(PATH_BACKUP_CLUSTER, undef, backupRegExpGet(1, 1, 1), 'reverse');
- }
- else
- {
- confess &log(ERROR, "unknown archive_retention_type '${strArchiveRetentionType}'");
- }
-
- # Make sure that iArchiveRetention is set and valid
- if (!defined($iArchiveRetention))
- {
- confess &log(ERROR, 'archive_rentention must be set if archive_retention_type is set');
- return;
- }
-
- if (!looks_like_number($iArchiveRetention) || $iArchiveRetention < 1)
- {
- confess &log(ERROR, 'archive_rentention must be a number >= 1');
- }
-
- # if no backups were found then preserve current archive logs - too scary to delete them!
- my $iBackupTotal = scalar @stryPath;
-
- if ($iBackupTotal == 0)
- {
- return;
- }
-
- # See if enough backups exist for expiration to start
- my $strArchiveRetentionBackup = $stryPath[$iArchiveRetention - 1];
-
- if (!defined($strArchiveRetentionBackup))
- {
- if ($strArchiveRetentionType eq BACKUP_TYPE_FULL && scalar @stryPath > 0)
- {
- &log(INFO, 'fewer than required backups for retention, but since archive_retention_type = full using oldest full backup');
- $strArchiveRetentionBackup = $stryPath[scalar @stryPath - 1];
- }
-
- if (!defined($strArchiveRetentionBackup))
- {
- return;
- }
- }
-
- # Get the archive logs that need to be kept. To be cautious we will keep all the archive logs starting from this backup
- # even though they are also in the pg_xlog directory (since they have been copied more than once).
- &log(INFO, 'archive retention based on backup ' . $strArchiveRetentionBackup);
-
- my $oManifest = new BackRest::Manifest($oFile->path_get(PATH_BACKUP_CLUSTER) . "/${strArchiveRetentionBackup}/backup.manifest");
- my $strArchiveLast = $oManifest->get(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_ARCHIVE_START);
-
- if (!defined($strArchiveLast))
- {
- confess &log(ERROR, "invalid archive location retrieved ${strArchiveRetentionBackup}");
- }
-
- &log(INFO, 'archive retention starts at ' . $strArchiveLast);
-
- # Get archive info
- my $oArchive = new BackRest::Archive();
- my $strArchiveId = $oArchive->getCheck($oFile);
-
- # Remove any archive directories or files that are out of date
- foreach $strPath ($oFile->list(PATH_BACKUP_ARCHIVE, $strArchiveId, "^[0-F]{16}\$"))
- {
- &log(DEBUG, 'found major archive path ' . $strPath);
-
- # If less than first 16 characters of current archive file, then remove the directory
- if ($strPath lt substr($strArchiveLast, 0, 16))
- {
- my $strFullPath = $oFile->path_get(PATH_BACKUP_ARCHIVE, $strArchiveId) . "/${strPath}";
-
- remove_tree($strFullPath) > 0 or confess &log(ERROR, "unable to remove ${strFullPath}");
-
- &log(DEBUG, 'remove major archive path ' . $strFullPath);
- }
- # If equals the first 16 characters of the current archive file, then delete individual files instead
- elsif ($strPath eq substr($strArchiveLast, 0, 16))
- {
- my $strSubPath;
-
- # Look for archive files in the archive directory
- foreach $strSubPath ($oFile->list(PATH_BACKUP_ARCHIVE, "${strArchiveId}/${strPath}", "^[0-F]{24}.*\$"))
- {
- # Delete if the first 24 characters less than the current archive file
- if ($strSubPath lt substr($strArchiveLast, 0, 24))
- {
- unlink($oFile->path_get(PATH_BACKUP_ARCHIVE, "${strArchiveId}/${strSubPath}"))
- or confess &log(ERROR, 'unable to remove ' . $strSubPath);
- &log(DEBUG, 'remove expired archive file ' . $strSubPath);
- }
- }
- }
- }
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation
+ );
}
1;
diff --git a/lib/BackRest/BackupCommon.pm b/lib/BackRest/BackupCommon.pm
index 3f7fd725e..545e512c8 100644
--- a/lib/BackRest/BackupCommon.pm
+++ b/lib/BackRest/BackupCommon.pm
@@ -8,25 +8,43 @@ use warnings FATAL => qw(all);
use Carp qw(confess);
use Exporter qw(import);
+ our @EXPORT = qw();
use File::Basename;
use lib dirname($0);
-use BackRest::Utility;
+use BackRest::Common::Log;
+
+####################################################################################################################################
+# Operation constants
+####################################################################################################################################
+use constant OP_BACKUP_COMMON => 'BackupCommon';
+
+use constant OP_BACKUP_COMMON_REG_EXP_GET => OP_BACKUP_COMMON . '::backupRegExpGet';
####################################################################################################################################
# backupRegExpGet - Generate a regexp depending on the backups that need to be found
####################################################################################################################################
-our @EXPORT = qw(backupRegExpGet);
-
sub backupRegExpGet
{
- my $bFull = shift;
- my $bDifferential = shift;
- my $bIncremental = shift;
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $bFull,
+ $bDifferential,
+ $bIncremental
+ ) =
+ logDebugParam
+ (
+ OP_BACKUP_COMMON_REG_EXP_GET, \@_,
+ {name => 'bFull', default => false},
+ {name => 'bDifferential', default => false},
+ {name => 'bIncremental', default => false}
+ );
if (!$bFull && !$bDifferential && !$bIncremental)
{
- confess &log(ERROR, 'one parameter must be true');
+ confess &log(ASSERT, 'one parameter must be true');
}
my $strDateTimeRegExp = "[0-9]{8}\\-[0-9]{6}";
@@ -71,10 +89,14 @@ sub backupRegExpGet
$strRegExp .= "\$";
- &log(DEBUG, "BackupCommon::backupRegExpGet:" .
- " full = ${bFull}, differential = ${bDifferential}, incremental = ${bIncremental}: $strRegExp");
-
- return $strRegExp;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'strRegExp', value => $strRegExp}
+ );
}
+push @EXPORT, qw(backupRegExpGet);
+
1;
diff --git a/lib/BackRest/BackupFile.pm b/lib/BackRest/BackupFile.pm
index 849b6357c..1c598a617 100644
--- a/lib/BackRest/BackupFile.pm
+++ b/lib/BackRest/BackupFile.pm
@@ -10,32 +10,60 @@ use warnings FATAL => qw(all);
use Carp qw(confess);
use Exporter qw(import);
+ our @EXPORT = qw();
use File::Basename qw(dirname);
use lib dirname($0);
-use BackRest::Exception;
+use BackRest::Common::Exception;
+use BackRest::Common::Log;
+use BackRest::Common::String;
use BackRest::File;
use BackRest::Manifest;
-use BackRest::Utility;
+
+####################################################################################################################################
+# Operation constants
+####################################################################################################################################
+use constant OP_BACKUP_FILE => 'BackupFile';
+
+use constant OP_BACKUP_FILE_BACKUP_FILE => OP_BACKUP_FILE . '::backupFile';
+use constant OP_BACKUP_FILE_BACKUP_MANIFEST_UPDATE => OP_BACKUP_FILE . '::backupManifestUpdate';
####################################################################################################################################
# backupFile
####################################################################################################################################
sub backupFile
{
- my $oFile = shift; # File object
- my $strSourceFile = shift; # Source file to backup
- my $strDestinationFile = shift; # Destination backup file
- my $bDestinationCompress = shift; # Compress destination file
- my $strChecksum = shift; # File checksum to be checked
- my $lModificationTime = shift; # File modification time
- my $lSizeFile = shift; # File size
- my $lSizeTotal = shift; # Total size of the files to be copied
- my $lSizeCurrent = shift; # Size of files copied so far
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $oFile, # File object
+ $strSourceFile, # Source file to backup
+ $strDestinationFile, # Destination backup file
+ $bDestinationCompress, # Compress destination file
+ $strChecksum, # File checksum to be checked
+ $lModificationTime, # File modification time
+ $lSizeFile, # File size
+ $lSizeTotal, # Total size of the files to be copied
+ $lSizeCurrent, # Size of files copied so far
+ ) =
+ logDebugParam
+ (
+ OP_BACKUP_FILE_BACKUP_FILE, \@_,
+ {name => 'oFile', trace => true},
+ {name => 'strSourceFile', trace => true},
+ {name => 'strDestinationFile', trace => true},
+ {name => 'bDestinationCompress', trace => true},
+ {name => 'strChecksum', required => false, trace => true},
+ {name => 'lModificationTime', trace => true},
+ {name => 'lSizeFile', trace => true},
+ {name => 'lSizeTotal', trace => true},
+ {name => 'lSizeCurrent', trace => true}
+ );
- my $bCopyResult; # Copy result
- my $strCopyChecksum; # Copy checksum
- my $lCopySize; # Copy Size
+ my $bCopyResult = true; # Copy result
+ my $strCopyChecksum; # Copy checksum
+ my $lCopySize; # Copy Size
# Add the size of the current file to keep track of percent complete
$lSizeCurrent += $lSizeFile;
@@ -45,7 +73,9 @@ sub backupFile
if (defined($strChecksum))
{
- ($strCopyChecksum, $lCopySize) = $oFile->hash_size(PATH_BACKUP_TMP, $strDestinationFile);
+ ($strCopyChecksum, $lCopySize) =
+ $oFile->hashSize(PATH_BACKUP_TMP, $strDestinationFile .
+ ($bDestinationCompress ? '.' . $oFile->{strCompressExtension} : ''), $bDestinationCompress);
$bCopy = !($strCopyChecksum eq $strChecksum && $lCopySize == $lSizeFile);
@@ -75,35 +105,61 @@ sub backupFile
{
# If file is missing assume the database removed it (else corruption and nothing we can do!)
&log(INFO, "skip file removed by database: " . $strSourceFile);
-
- return false, $lSizeCurrent, undef, undef;
}
}
# Ouput log
- &log(INFO, (defined($strChecksum) && !$bCopy ? 'checksum resumed file' : 'backup file') .
- " $strSourceFile (" . file_size_format($lCopySize) .
- ($lSizeTotal > 0 ? ', ' . int($lSizeCurrent * 100 / $lSizeTotal) . '%' : '') . ')' .
- ($lCopySize != 0 ? " checksum ${strCopyChecksum}" : ''));
+ if ($bCopyResult)
+ {
+ &log(INFO, (defined($strChecksum) && !$bCopy ? 'checksum resumed file' : 'backup file') .
+ " $strSourceFile (" . fileSizeFormat($lCopySize) .
+ ($lSizeTotal > 0 ? ', ' . int($lSizeCurrent * 100 / $lSizeTotal) . '%' : '') . ')' .
+ ($lCopySize != 0 ? " checksum ${strCopyChecksum}" : ''));
+ }
- return true, $lSizeCurrent, $lCopySize, $strCopyChecksum;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'bCopyResult', value => $bCopyResult, trace => true},
+ {name => 'lSizeCurrent', value => $lSizeCurrent, trace => true},
+ {name => 'lCopySize', value => $lCopySize, trace => true},
+ {name => 'strCopyChecksum', value => $strCopyChecksum, trace => true}
+ );
}
-our @EXPORT = qw(backupFile);
+push @EXPORT, qw(backupFile);
####################################################################################################################################
# backupManifestUpdate
####################################################################################################################################
sub backupManifestUpdate
{
- my $oManifest = shift;
- my $strSection = shift;
- my $strFile = shift;
- my $bCopied = shift;
- my $lSize = shift;
- my $strChecksum = shift;
- my $lManifestSaveSize = shift;
- my $lManifestSaveCurrent = shift;
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $oManifest,
+ $strSection,
+ $strFile,
+ $bCopied,
+ $lSize,
+ $strChecksum,
+ $lManifestSaveSize,
+ $lManifestSaveCurrent
+ ) =
+ logDebugParam
+ (
+ OP_BACKUP_FILE_BACKUP_MANIFEST_UPDATE, \@_,
+ {name => 'oManifest', trace => true},
+ {name => 'strSection', trace => true},
+ {name => 'strFile', trace => true},
+ {name => 'bCopied', trace => true},
+ {name => 'lSize', required => false, trace => true},
+ {name => 'strChecksum', required => false, trace => true},
+ {name => 'lManifestSaveSize', trace => true},
+ {name => 'lManifestSaveCurrent', trace => true}
+ );
# If copy was successful store the checksum and size
if ($bCopied)
@@ -121,7 +177,12 @@ sub backupManifestUpdate
if ($lManifestSaveCurrent >= $lManifestSaveSize)
{
$oManifest->save();
- &log(DEBUG, 'manifest saved');
+ logDebugMisc
+ (
+ $strOperation, 'save manifest',
+ {name => 'lManifestSaveSize', value => $lManifestSaveSize},
+ {name => 'lManifestSaveCurrent', value => $lManifestSaveCurrent}
+ );
$lManifestSaveCurrent = 0;
}
@@ -132,7 +193,12 @@ sub backupManifestUpdate
$oManifest->remove($strSection, $strFile);
}
- return $lManifestSaveCurrent;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'lManifestSaveCurrent', value => $lManifestSaveCurrent, trace => true}
+ );
}
push @EXPORT, qw(backupManifestUpdate);
diff --git a/lib/BackRest/BackupInfo.pm b/lib/BackRest/BackupInfo.pm
index a5cd90a15..5ce66a737 100644
--- a/lib/BackRest/BackupInfo.pm
+++ b/lib/BackRest/BackupInfo.pm
@@ -2,101 +2,104 @@
# BACKUP INFO MODULE
####################################################################################################################################
package BackRest::BackupInfo;
-use parent 'BackRest::Ini';
+use parent 'BackRest::Common::Ini';
use strict;
use warnings FATAL => qw(all);
use Carp qw(confess);
use Exporter qw(import);
+ our @EXPORT = qw();
use File::Basename qw(dirname basename);
use File::stat;
use lib dirname($0);
+use BackRest::Common::Exception;
+use BackRest::Common::Ini;
+use BackRest::Common::Log;
use BackRest::Config;
-use BackRest::Exception;
use BackRest::File;
-use BackRest::Ini;
use BackRest::Manifest;
-use BackRest::Utility;
####################################################################################################################################
# Operation constants
####################################################################################################################################
-use constant OP_BACKUP_INFO => 'BackupInfo';
+use constant OP_BACKUP_INFO => 'BackupInfo';
-use constant OP_INFO_BACKUP_NEW => OP_BACKUP_INFO . "->new";
-use constant OP_INFO_BACKUP_BACKUP_ADD => OP_BACKUP_INFO . "->backupAdd";
-use constant OP_INFO_BACKUP_BACKUP_REMOVE => OP_BACKUP_INFO . "->backupRemove";
+use constant OP_INFO_BACKUP_ADD => OP_BACKUP_INFO . "->add";
+use constant OP_INFO_BACKUP_CHECK => OP_BACKUP_INFO . "->check";
+use constant OP_INFO_BACKUP_DELETE => OP_BACKUP_INFO . "->delete";
+use constant OP_INFO_BACKUP_NEW => OP_BACKUP_INFO . "->new";
####################################################################################################################################
# File/path constants
####################################################################################################################################
-use constant FILE_BACKUP_INFO => 'backup.info'; our @EXPORT = qw(FILE_BACKUP_INFO);
+use constant FILE_BACKUP_INFO => 'backup.info';
+ push @EXPORT, qw(FILE_BACKUP_INFO);
####################################################################################################################################
-# Backup info Constants
+# Backup info constants
####################################################################################################################################
-use constant INFO_BACKUP_SECTION_BACKUP => MANIFEST_SECTION_BACKUP;
+use constant INFO_BACKUP_SECTION_BACKUP => MANIFEST_SECTION_BACKUP;
push @EXPORT, qw(INFO_BACKUP_SECTION_BACKUP);
-use constant INFO_BACKUP_SECTION_BACKUP_CURRENT => INFO_BACKUP_SECTION_BACKUP . ':current';
+use constant INFO_BACKUP_SECTION_BACKUP_CURRENT => INFO_BACKUP_SECTION_BACKUP . ':current';
push @EXPORT, qw(INFO_BACKUP_SECTION_BACKUP_CURRENT);
-use constant INFO_BACKUP_SECTION_BACKUP_HISTORY => INFO_BACKUP_SECTION_BACKUP . ':history';
+use constant INFO_BACKUP_SECTION_BACKUP_HISTORY => INFO_BACKUP_SECTION_BACKUP . ':history';
push @EXPORT, qw(INFO_BACKUP_SECTION_BACKUP_HISTORY);
-use constant INFO_BACKUP_SECTION_DB => 'db';
+use constant INFO_BACKUP_SECTION_DB => 'db';
push @EXPORT, qw(INFO_BACKUP_SECTION_DB);
-use constant INFO_BACKUP_SECTION_DB_HISTORY => INFO_BACKUP_SECTION_DB . ':history';
+use constant INFO_BACKUP_SECTION_DB_HISTORY => INFO_BACKUP_SECTION_DB . ':history';
push @EXPORT, qw(INFO_BACKUP_SECTION_DB_HISTORY);
-use constant INFO_BACKUP_KEY_ARCHIVE_CHECK => MANIFEST_KEY_ARCHIVE_CHECK;
+use constant INFO_BACKUP_KEY_ARCHIVE_CHECK => MANIFEST_KEY_ARCHIVE_CHECK;
push @EXPORT, qw(INFO_BACKUP_KEY_ARCHIVE_CHECK);
-use constant INFO_BACKUP_KEY_ARCHIVE_COPY => MANIFEST_KEY_ARCHIVE_COPY;
+use constant INFO_BACKUP_KEY_ARCHIVE_COPY => MANIFEST_KEY_ARCHIVE_COPY;
push @EXPORT, qw(INFO_BACKUP_KEY_ARCHIVE_COPY);
-use constant INFO_BACKUP_KEY_ARCHIVE_START => MANIFEST_KEY_ARCHIVE_START;
+use constant INFO_BACKUP_KEY_ARCHIVE_START => MANIFEST_KEY_ARCHIVE_START;
push @EXPORT, qw(INFO_BACKUP_KEY_ARCHIVE_START);
-use constant INFO_BACKUP_KEY_ARCHIVE_STOP => MANIFEST_KEY_ARCHIVE_STOP;
+use constant INFO_BACKUP_KEY_ARCHIVE_STOP => MANIFEST_KEY_ARCHIVE_STOP;
push @EXPORT, qw(INFO_BACKUP_KEY_ARCHIVE_STOP);
-use constant INFO_BACKUP_KEY_BACKUP_REPO_SIZE => 'backup-info-repo-size';
+use constant INFO_BACKUP_KEY_BACKUP_REPO_SIZE => 'backup-info-repo-size';
push @EXPORT, qw(INFO_BACKUP_KEY_BACKUP_REPO_SIZE);
-use constant INFO_BACKUP_KEY_BACKUP_REPO_SIZE_DELTA => 'backup-info-repo-size-delta';
+use constant INFO_BACKUP_KEY_BACKUP_REPO_SIZE_DELTA => 'backup-info-repo-size-delta';
push @EXPORT, qw(INFO_BACKUP_KEY_BACKUP_REPO_SIZE_DELTA);
-use constant INFO_BACKUP_KEY_BACKUP_SIZE => 'backup-info-size';
+use constant INFO_BACKUP_KEY_BACKUP_SIZE => 'backup-info-size';
push @EXPORT, qw(INFO_BACKUP_KEY_BACKUP_SIZE);
-use constant INFO_BACKUP_KEY_BACKUP_SIZE_DELTA => 'backup-info-size-delta';
+use constant INFO_BACKUP_KEY_BACKUP_SIZE_DELTA => 'backup-info-size-delta';
push @EXPORT, qw(INFO_BACKUP_KEY_BACKUP_SIZE_DELTA);
-use constant INFO_BACKUP_KEY_CATALOG => MANIFEST_KEY_CATALOG;
+use constant INFO_BACKUP_KEY_CATALOG => MANIFEST_KEY_CATALOG;
push @EXPORT, qw(INFO_BACKUP_KEY_CATALOG);
-use constant INFO_BACKUP_KEY_CONTROL => MANIFEST_KEY_CONTROL;
+use constant INFO_BACKUP_KEY_CONTROL => MANIFEST_KEY_CONTROL;
push @EXPORT, qw(INFO_BACKUP_KEY_CONTROL);
-use constant INFO_BACKUP_KEY_COMPRESS => MANIFEST_KEY_COMPRESS;
+use constant INFO_BACKUP_KEY_COMPRESS => MANIFEST_KEY_COMPRESS;
push @EXPORT, qw(INFO_BACKUP_KEY_COMPRESS);
-use constant INFO_BACKUP_KEY_CHECKSUM => INI_KEY_CHECKSUM;
+use constant INFO_BACKUP_KEY_CHECKSUM => INI_KEY_CHECKSUM;
push @EXPORT, qw(INFO_BACKUP_KEY_CHECKSUM);
-use constant INFO_BACKUP_KEY_DB_VERSION => MANIFEST_KEY_DB_VERSION;
+use constant INFO_BACKUP_KEY_DB_VERSION => MANIFEST_KEY_DB_VERSION;
push @EXPORT, qw(INFO_BACKUP_KEY_DB_VERSION);
-use constant INFO_BACKUP_KEY_FORMAT => INI_KEY_FORMAT;
+use constant INFO_BACKUP_KEY_FORMAT => INI_KEY_FORMAT;
push @EXPORT, qw(INFO_BACKUP_KEY_FORMAT);
-use constant INFO_BACKUP_KEY_HARDLINK => MANIFEST_KEY_HARDLINK;
+use constant INFO_BACKUP_KEY_HARDLINK => MANIFEST_KEY_HARDLINK;
push @EXPORT, qw(INFO_BACKUP_KEY_HARDLINK);
-use constant INFO_BACKUP_KEY_HISTORY_ID => 'db-id';
+use constant INFO_BACKUP_KEY_HISTORY_ID => 'db-id';
push @EXPORT, qw(INFO_BACKUP_KEY_HISTORY_ID);
-use constant INFO_BACKUP_KEY_LABEL => MANIFEST_KEY_LABEL;
+use constant INFO_BACKUP_KEY_LABEL => MANIFEST_KEY_LABEL;
push @EXPORT, qw(INFO_BACKUP_KEY_LABEL);
-use constant INFO_BACKUP_KEY_PRIOR => MANIFEST_KEY_PRIOR;
+use constant INFO_BACKUP_KEY_PRIOR => MANIFEST_KEY_PRIOR;
push @EXPORT, qw(INFO_BACKUP_KEY_PRIOR);
-use constant INFO_BACKUP_KEY_REFERENCE => 'backup-reference';
+use constant INFO_BACKUP_KEY_REFERENCE => 'backup-reference';
push @EXPORT, qw(INFO_BACKUP_KEY_REFERENCE);
-use constant INFO_BACKUP_KEY_START_STOP => MANIFEST_KEY_START_STOP;
+use constant INFO_BACKUP_KEY_START_STOP => MANIFEST_KEY_START_STOP;
push @EXPORT, qw(INFO_BACKUP_KEY_START_STOP);
-use constant INFO_BACKUP_KEY_SYSTEM_ID => MANIFEST_KEY_SYSTEM_ID;
+use constant INFO_BACKUP_KEY_SYSTEM_ID => MANIFEST_KEY_SYSTEM_ID;
push @EXPORT, qw(INFO_BACKUP_KEY_SYSTEM_ID);
-use constant INFO_BACKUP_KEY_TIMESTAMP_START => MANIFEST_KEY_TIMESTAMP_START;
+use constant INFO_BACKUP_KEY_TIMESTAMP_START => MANIFEST_KEY_TIMESTAMP_START;
push @EXPORT, qw(INFO_BACKUP_KEY_TIMESTAMP_START);
-use constant INFO_BACKUP_KEY_TIMESTAMP_STOP => MANIFEST_KEY_TIMESTAMP_STOP;
+use constant INFO_BACKUP_KEY_TIMESTAMP_STOP => MANIFEST_KEY_TIMESTAMP_STOP;
push @EXPORT, qw(INFO_BACKUP_KEY_TIMESTAMP_STOP);
-use constant INFO_BACKUP_KEY_TYPE => MANIFEST_KEY_TYPE;
+use constant INFO_BACKUP_KEY_TYPE => MANIFEST_KEY_TYPE;
push @EXPORT, qw(INFO_BACKUP_KEY_TYPE);
-use constant INFO_BACKUP_KEY_VERSION => INI_KEY_VERSION;
+use constant INFO_BACKUP_KEY_VERSION => INI_KEY_VERSION;
push @EXPORT, qw(INFO_BACKUP_KEY_VERSION);
####################################################################################################################################
@@ -104,10 +107,19 @@ use constant INFO_BACKUP_KEY_VERSION => INI_KEY_VERSION;
####################################################################################################################################
sub new
{
- my $class = shift; # Class name
- my $strBackupClusterPath = shift; # Backup cluster path
+ my $class = shift;
- &log(DEBUG, OP_INFO_BACKUP_NEW . ": backupClusterPath = ${strBackupClusterPath}");
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strBackupClusterPath # Backup cluster path
+ ) =
+ logDebugParam
+ (
+ OP_INFO_BACKUP_NEW, \@_,
+ {name => 'strBackupClusterPath'}
+ );
# Build the backup info path/file name
my $strBackupInfoFile = "${strBackupClusterPath}/" . FILE_BACKUP_INFO;
@@ -122,7 +134,12 @@ sub new
# Validate the backup info
$self->validate();
- return $self;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'self', value => $self}
+ );
}
####################################################################################################################################
@@ -134,15 +151,31 @@ sub validate
{
my $self = shift;
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ ) =
+ logDebugParam
+ (
+ OP_INFO_BACKUP_NEW
+ );
+
# Remove backups that no longer exist on disk
foreach my $strBackup ($self->keys(INFO_BACKUP_SECTION_BACKUP_CURRENT))
{
if (!-e "$self->{strBackupClusterPath}/${strBackup}")
{
&log(WARN, "backup ${strBackup} is missing from the repository - removed from " . FILE_BACKUP_INFO);
- $self->remove(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackup);
+ $self->delete($strBackup);
}
}
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation
+ );
}
####################################################################################################################################
@@ -153,11 +186,22 @@ sub validate
sub check
{
my $self = shift;
- my $oBackupManifest = shift;
- my $iCatalogVersion = $oBackupManifest->getNumeric(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_CATALOG);
- my $iControlVersion = $oBackupManifest->getNumeric(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_CONTROL);
- my $ullDbSysId = $oBackupManifest->getNumeric(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_SYSTEM_ID);
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $oBackupManifest
+ ) =
+ logDebugParam
+ (
+ OP_INFO_BACKUP_CHECK, \@_,
+ {name => 'oBackupManifest', trace => true}
+ );
+
+ my $iCatalogVersion = $oBackupManifest->numericGet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_CATALOG);
+ my $iControlVersion = $oBackupManifest->numericGet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_CONTROL);
+ my $ullDbSysId = $oBackupManifest->numericGet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_SYSTEM_ID);
my $strDbVersion = $oBackupManifest->get(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_DB_VERSION);
if (!$self->test(INFO_BACKUP_SECTION_DB))
@@ -165,16 +209,16 @@ sub check
my $iHistoryId = 1;
# Fill db section
- $self->setNumeric(INFO_BACKUP_SECTION_DB, INFO_BACKUP_KEY_CATALOG, undef, $iCatalogVersion);
- $self->setNumeric(INFO_BACKUP_SECTION_DB, INFO_BACKUP_KEY_CONTROL, undef, $iControlVersion);
- $self->setNumeric(INFO_BACKUP_SECTION_DB, INFO_BACKUP_KEY_SYSTEM_ID, undef, $ullDbSysId);
+ $self->numericSet(INFO_BACKUP_SECTION_DB, INFO_BACKUP_KEY_CATALOG, undef, $iCatalogVersion);
+ $self->numericSet(INFO_BACKUP_SECTION_DB, INFO_BACKUP_KEY_CONTROL, undef, $iControlVersion);
+ $self->numericSet(INFO_BACKUP_SECTION_DB, INFO_BACKUP_KEY_SYSTEM_ID, undef, $ullDbSysId);
$self->set(INFO_BACKUP_SECTION_DB, INFO_BACKUP_KEY_DB_VERSION, undef, $strDbVersion);
- $self->setNumeric(INFO_BACKUP_SECTION_DB, INFO_BACKUP_KEY_HISTORY_ID, undef, $iHistoryId);
+ $self->numericSet(INFO_BACKUP_SECTION_DB, INFO_BACKUP_KEY_HISTORY_ID, undef, $iHistoryId);
# Fill db history
- $self->setNumeric(INFO_BACKUP_SECTION_DB_HISTORY, $iHistoryId, INFO_BACKUP_KEY_CATALOG, $iCatalogVersion);
- $self->setNumeric(INFO_BACKUP_SECTION_DB_HISTORY, $iHistoryId, INFO_BACKUP_KEY_CONTROL, $iControlVersion);
- $self->setNumeric(INFO_BACKUP_SECTION_DB_HISTORY, $iHistoryId, INFO_BACKUP_KEY_SYSTEM_ID, $ullDbSysId);
+ $self->numericSet(INFO_BACKUP_SECTION_DB_HISTORY, $iHistoryId, INFO_BACKUP_KEY_CATALOG, $iCatalogVersion);
+ $self->numericSet(INFO_BACKUP_SECTION_DB_HISTORY, $iHistoryId, INFO_BACKUP_KEY_CONTROL, $iControlVersion);
+ $self->numericSet(INFO_BACKUP_SECTION_DB_HISTORY, $iHistoryId, INFO_BACKUP_KEY_SYSTEM_ID, $ullDbSysId);
$self->set(INFO_BACKUP_SECTION_DB_HISTORY, $iHistoryId, INFO_BACKUP_KEY_DB_VERSION, $strDbVersion);
}
else
@@ -198,23 +242,40 @@ sub check
"\nHINT: this may be a symptom of database or repository corruption!", ERROR_BACKUP_MISMATCH);
}
}
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation
+ );
}
####################################################################################################################################
-# backupAdd
+# add
#
# Add a backup to the info file.
####################################################################################################################################
-sub backupAdd
+sub add
{
my $self = shift;
- my $oFile = shift;
- my $oBackupManifest = shift;
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $oFile,
+ $oBackupManifest
+ ) =
+ logDebugParam
+ (
+ OP_INFO_BACKUP_ADD, \@_,
+ {name => 'oFile', trace => true},
+ {name => 'oBackupManifest', trace => true}
+ );
+
+ # !!! How best to log these follow-on cases?
my $strBackupLabel = $oBackupManifest->get(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_LABEL);
- &log(DEBUG, OP_INFO_BACKUP_BACKUP_ADD . ": backupLabel = ${strBackupLabel}");
-
# Calculate backup sizes and references
my $lBackupSize = 0;
my $lBackupSizeDelta = 0;
@@ -235,7 +296,7 @@ sub backupAdd
my $lFileSize = $oBackupManifest->get($strFileSection, $strFileKey, MANIFEST_SUBKEY_SIZE);
my $strFileReference = $oBackupManifest->get($strFileSection, $strFileKey, MANIFEST_SUBKEY_REFERENCE, false);
- my $strFile = $oFile->path_get(PATH_BACKUP_CLUSTER,
+ my $strFile = $oFile->pathGet(PATH_BACKUP_CLUSTER,
(defined($strFileReference) ? "${strFileReference}" : $strBackupLabel) .
"/${strPath}/${strFileKey}" .
($bCompress ? '.' . $oFile->{strCompressExtension} : ''));
@@ -262,7 +323,7 @@ sub backupAdd
}
# Add the manifest.backup size
- my $strManifestFile = $oFile->path_get(PATH_BACKUP_CLUSTER, "/${strBackupLabel}/" . FILE_MANIFEST);
+ my $strManifestFile = $oFile->pathGet(PATH_BACKUP_CLUSTER, "/${strBackupLabel}/" . FILE_MANIFEST);
my $oStat = lstat($strManifestFile);
# Check for errors in stat
@@ -273,33 +334,33 @@ sub backupAdd
$lBackupRepoSizeDelta += $oStat->size;
# Set backup size info
- $self->setNumeric(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackupLabel, INFO_BACKUP_KEY_BACKUP_SIZE, $lBackupSize);
- $self->setNumeric(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackupLabel, INFO_BACKUP_KEY_BACKUP_SIZE_DELTA, $lBackupSizeDelta);
- $self->setNumeric(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackupLabel, INFO_BACKUP_KEY_BACKUP_REPO_SIZE, $lBackupRepoSize);
- $self->setNumeric(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackupLabel, INFO_BACKUP_KEY_BACKUP_REPO_SIZE_DELTA,
+ $self->numericSet(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackupLabel, INFO_BACKUP_KEY_BACKUP_SIZE, $lBackupSize);
+ $self->numericSet(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackupLabel, INFO_BACKUP_KEY_BACKUP_SIZE_DELTA, $lBackupSizeDelta);
+ $self->numericSet(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackupLabel, INFO_BACKUP_KEY_BACKUP_REPO_SIZE, $lBackupRepoSize);
+ $self->numericSet(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackupLabel, INFO_BACKUP_KEY_BACKUP_REPO_SIZE_DELTA,
$lBackupRepoSizeDelta);
# Store information about the backup into the backup section
- $self->setBool(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackupLabel, INFO_BACKUP_KEY_ARCHIVE_CHECK,
- $oBackupManifest->getBool(MANIFEST_SECTION_BACKUP_OPTION, MANIFEST_KEY_ARCHIVE_CHECK));
- $self->setBool(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackupLabel, INFO_BACKUP_KEY_ARCHIVE_COPY,
- $oBackupManifest->getBool(MANIFEST_SECTION_BACKUP_OPTION, MANIFEST_KEY_ARCHIVE_COPY));
+ $self->boolSet(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackupLabel, INFO_BACKUP_KEY_ARCHIVE_CHECK,
+ $oBackupManifest->boolGet(MANIFEST_SECTION_BACKUP_OPTION, MANIFEST_KEY_ARCHIVE_CHECK));
+ $self->boolSet(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackupLabel, INFO_BACKUP_KEY_ARCHIVE_COPY,
+ $oBackupManifest->boolGet(MANIFEST_SECTION_BACKUP_OPTION, MANIFEST_KEY_ARCHIVE_COPY));
$self->set(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackupLabel, INFO_BACKUP_KEY_ARCHIVE_START,
$oBackupManifest->get(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_ARCHIVE_START, undef, false));
$self->set(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackupLabel, INFO_BACKUP_KEY_ARCHIVE_STOP,
$oBackupManifest->get(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_ARCHIVE_STOP, undef, false));
- $self->setBool(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackupLabel, INFO_BACKUP_KEY_COMPRESS,
- $oBackupManifest->getBool(MANIFEST_SECTION_BACKUP_OPTION, MANIFEST_KEY_COMPRESS));
- $self->setNumeric(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackupLabel, INFO_BACKUP_KEY_FORMAT,
- $oBackupManifest->getNumeric(INI_SECTION_BACKREST, INI_KEY_FORMAT));
- $self->setBool(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackupLabel, INFO_BACKUP_KEY_HARDLINK,
- $oBackupManifest->getBool(MANIFEST_SECTION_BACKUP_OPTION, MANIFEST_KEY_HARDLINK));
- $self->setBool(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackupLabel, INFO_BACKUP_KEY_START_STOP,
- $oBackupManifest->getBool(MANIFEST_SECTION_BACKUP_OPTION, MANIFEST_KEY_START_STOP));
- $self->setNumeric(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackupLabel, INFO_BACKUP_KEY_TIMESTAMP_START,
- $oBackupManifest->getNumeric(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_TIMESTAMP_START));
- $self->setNumeric(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackupLabel, INFO_BACKUP_KEY_TIMESTAMP_STOP,
- $oBackupManifest->getNumeric(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_TIMESTAMP_STOP));
+ $self->boolSet(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackupLabel, INFO_BACKUP_KEY_COMPRESS,
+ $oBackupManifest->boolGet(MANIFEST_SECTION_BACKUP_OPTION, MANIFEST_KEY_COMPRESS));
+ $self->numericSet(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackupLabel, INFO_BACKUP_KEY_FORMAT,
+ $oBackupManifest->numericGet(INI_SECTION_BACKREST, INI_KEY_FORMAT));
+ $self->boolSet(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackupLabel, INFO_BACKUP_KEY_HARDLINK,
+ $oBackupManifest->boolGet(MANIFEST_SECTION_BACKUP_OPTION, MANIFEST_KEY_HARDLINK));
+ $self->boolSet(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackupLabel, INFO_BACKUP_KEY_START_STOP,
+ $oBackupManifest->boolGet(MANIFEST_SECTION_BACKUP_OPTION, MANIFEST_KEY_START_STOP));
+ $self->numericSet(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackupLabel, INFO_BACKUP_KEY_TIMESTAMP_START,
+ $oBackupManifest->numericGet(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_TIMESTAMP_START));
+ $self->numericSet(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackupLabel, INFO_BACKUP_KEY_TIMESTAMP_STOP,
+ $oBackupManifest->numericGet(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_TIMESTAMP_STOP));
$self->set(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackupLabel, INFO_BACKUP_KEY_TYPE,
$oBackupManifest->get(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_TYPE));
$self->set(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackupLabel, INFO_BACKUP_KEY_VERSION,
@@ -322,22 +383,43 @@ sub backupAdd
$self->get(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackupLabel));
$self->save();
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation
+ );
}
####################################################################################################################################
-# backupRemove
+# Delete
#
-# Remove a backup from the info file.
+# Delete a backup from the info file.
####################################################################################################################################
-sub backupRemove
+sub delete
{
my $self = shift;
- my $strBackupLabel = shift;
- &log(DEBUG, OP_INFO_BACKUP_BACKUP_REMOVE . ": backupLabel = ${strBackupLabel}");
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strBackupLabel
+ ) =
+ logDebugParam
+ (
+ OP_INFO_BACKUP_DELETE, \@_,
+ {name => 'strBackupLabel'}
+ );
$self->remove(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackupLabel);
$self->save();
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation
+ );
}
1;
diff --git a/lib/BackRest/Common/Exception.pm b/lib/BackRest/Common/Exception.pm
new file mode 100644
index 000000000..3de9346aa
--- /dev/null
+++ b/lib/BackRest/Common/Exception.pm
@@ -0,0 +1,146 @@
+####################################################################################################################################
+# COMMON EXCEPTION MODULE
+####################################################################################################################################
+package BackRest::Common::Exception;
+
+use strict;
+use warnings FATAL => qw(all);
+use Carp qw(confess longmess);
+
+use Exporter qw(import);
+ our @EXPORT = qw();
+
+####################################################################################################################################
+# Exception codes
+####################################################################################################################################
+use constant ERROR_ASSERT => 100;
+ push @EXPORT, qw(ERROR_ASSERT);
+use constant ERROR_CHECKSUM => 101;
+ push @EXPORT, qw(ERROR_CHECKSUM);
+use constant ERROR_CONFIG => 102;
+ push @EXPORT, qw(ERROR_CONFIG);
+use constant ERROR_FILE_INVALID => 103;
+ push @EXPORT, qw(ERROR_FILE_INVALID);
+use constant ERROR_FORMAT => 104;
+ push @EXPORT, qw(ERROR_FORMAT);
+use constant ERROR_COMMAND_REQUIRED => 105;
+ push @EXPORT, qw(ERROR_COMMAND_REQUIRED);
+use constant ERROR_OPTION_INVALID => 106;
+ push @EXPORT, qw(ERROR_OPTION_INVALID);
+use constant ERROR_OPTION_INVALID_VALUE => 107;
+ push @EXPORT, qw(ERROR_OPTION_INVALID_VALUE);
+use constant ERROR_OPTION_INVALID_RANGE => 108;
+ push @EXPORT, qw(ERROR_OPTION_INVALID_RANGE);
+use constant ERROR_OPTION_INVALID_PAIR => 109;
+ push @EXPORT, qw(ERROR_OPTION_INVALID_PAIR);
+use constant ERROR_OPTION_DUPLICATE_KEY => 110;
+ push @EXPORT, qw(ERROR_OPTION_DUPLICATE_KEY);
+use constant ERROR_OPTION_NEGATE => 111;
+ push @EXPORT, qw(ERROR_OPTION_NEGATE);
+use constant ERROR_OPTION_REQUIRED => 112;
+ push @EXPORT, qw(ERROR_OPTION_REQUIRED);
+use constant ERROR_POSTMASTER_RUNNING => 113;
+ push @EXPORT, qw(ERROR_POSTMASTER_RUNNING);
+use constant ERROR_PROTOCOL => 114;
+ push @EXPORT, qw(ERROR_PROTOCOL);
+use constant ERROR_RESTORE_PATH_NOT_EMPTY => 115;
+ push @EXPORT, qw(ERROR_RESTORE_PATH_NOT_EMPTY);
+use constant ERROR_FILE_OPEN => 116;
+ push @EXPORT, qw(ERROR_FILE_OPEN);
+use constant ERROR_FILE_READ => 117;
+ push @EXPORT, qw(ERROR_FILE_READ);
+use constant ERROR_PARAM_REQUIRED => 118;
+ push @EXPORT, qw(ERROR_PARAM_REQUIRED);
+use constant ERROR_ARCHIVE_MISMATCH => 119;
+ push @EXPORT, qw(ERROR_ARCHIVE_MISMATCH);
+use constant ERROR_ARCHIVE_DUPLICATE => 120;
+ push @EXPORT, qw(ERROR_ARCHIVE_DUPLICATE);
+use constant ERROR_VERSION_NOT_SUPPORTED => 121;
+ push @EXPORT, qw(ERROR_VERSION_NOT_SUPPORTED);
+use constant ERROR_PATH_CREATE => 122;
+ push @EXPORT, qw(ERROR_PATH_CREATE);
+use constant ERROR_COMMAND_INVALID => 123;
+ push @EXPORT, qw(ERROR_COMMAND_INVALID);
+use constant ERROR_HOST_CONNECT => 124;
+ push @EXPORT, qw(ERROR_HOST_CONNECT);
+use constant ERROR_LOCK_ACQUIRE => 125;
+ push @EXPORT, qw(ERROR_LOCK_ACQUIRE);
+use constant ERROR_BACKUP_MISMATCH => 126;
+ push @EXPORT, qw(ERROR_BACKUP_MISMATCH);
+use constant ERROR_FILE_SYNC => 127;
+ push @EXPORT, qw(ERROR_FILE_SYNC);
+use constant ERROR_PATH_OPEN => 128;
+ push @EXPORT, qw(ERROR_PATH_OPEN);
+use constant ERROR_PATH_SYNC => 129;
+ push @EXPORT, qw(ERROR_PATH_SYNC);
+use constant ERROR_FILE_MISSING => 130;
+ push @EXPORT, qw(ERROR_FILE_MISSING);
+use constant ERROR_DB_CONNECT => 131;
+ push @EXPORT, qw(ERROR_DB_CONNECT);
+use constant ERROR_DB_QUERY => 132;
+ push @EXPORT, qw(ERROR_DB_QUERY);
+use constant ERROR_DB_MISMATCH => 133;
+ push @EXPORT, qw(ERROR_DB_MISMATCH);
+use constant ERROR_DB_TIMEOUT => 134;
+ push @EXPORT, qw(ERROR_DB_TIMEOUT);
+use constant ERROR_FILE_REMOVE => 135;
+ push @EXPORT, qw(ERROR_FILE_REMOVE);
+use constant ERROR_PATH_REMOVE => 136;
+ push @EXPORT, qw(ERROR_PATH_REMOVE);
+
+use constant ERROR_UNKNOWN => 199;
+ push @EXPORT, qw(ERROR_UNKNOWN);
+
+####################################################################################################################################
+# CONSTRUCTOR
+####################################################################################################################################
+sub new
+{
+ my $class = shift; # Class name
+ my $iCode = shift; # Error code
+ my $strMessage = shift; # ErrorMessage
+ my $strTrace = shift; # Stack trace
+
+ # Create the class hash
+ my $self = {};
+ bless $self, $class;
+
+ # Initialize exception
+ $self->{iCode} = $iCode;
+ $self->{strMessage} = $strMessage;
+ $self->{strTrace} = $strTrace;
+
+ return $self;
+}
+
+####################################################################################################################################
+# CODE
+####################################################################################################################################
+sub code
+{
+ my $self = shift;
+
+ return $self->{iCode};
+}
+
+####################################################################################################################################
+# MESSAGE
+####################################################################################################################################
+sub message
+{
+ my $self = shift;
+
+ return $self->{strMessage};
+}
+
+####################################################################################################################################
+# TRACE
+####################################################################################################################################
+sub trace
+{
+ my $self = shift;
+
+ return $self->{strTrace};
+}
+
+1;
diff --git a/lib/BackRest/Ini.pm b/lib/BackRest/Common/Ini.pm
similarity index 96%
rename from lib/BackRest/Ini.pm
rename to lib/BackRest/Common/Ini.pm
index 6baf7bc81..7bcc54726 100644
--- a/lib/BackRest/Ini.pm
+++ b/lib/BackRest/Common/Ini.pm
@@ -1,13 +1,14 @@
####################################################################################################################################
-# INI MODULE
+# COMMON INI MODULE
####################################################################################################################################
-package BackRest::Ini;
+package BackRest::Common::Ini;
use strict;
use warnings FATAL => qw(all);
use Carp qw(confess);
use Exporter qw(import);
+ our @EXPORT = qw();
use Fcntl qw(:mode O_WRONLY O_CREAT O_TRUNC);
use File::Basename qw(dirname basename);
use IO::Handle;
@@ -15,9 +16,10 @@ use JSON::PP;
use Storable qw(dclone);
use lib dirname($0);
-use BackRest::Exception;
+use BackRest::Common::Exception;
+use BackRest::Common::Log;
+use BackRest::Common::String;
use BackRest::FileCommon;
-use BackRest::Utility;
use BackRest::Version;
####################################################################################################################################
@@ -31,7 +33,7 @@ use constant OP_INI_SET => OP_INI .
# Version and Format Constants
####################################################################################################################################
use constant BACKREST_VERSION => "$VERSION";
- our @EXPORT = qw(BACKREST_VERSION);
+ push @EXPORT, qw(BACKREST_VERSION);
use constant BACKREST_FORMAT => "$FORMAT";
push @EXPORT, qw(BACKREST_FORMAT);
@@ -100,13 +102,12 @@ sub new
if ($iFormat != BACKREST_FORMAT)
{
- confess &log(ERROR, "format of ${strFileName} is ${iFormat} but " . BACKREST_FORMAT . ' is required by this ' .
- ' version of PgBackRest.', ERROR_FORMAT);
+ confess &log(ERROR, "format of ${strFileName} is ${iFormat} but " . BACKREST_FORMAT . ' is required', ERROR_FORMAT);
}
}
else
{
- $self->setNumeric(INI_SECTION_BACKREST, INI_KEY_FORMAT, undef, BACKREST_FORMAT);
+ $self->numericSet(INI_SECTION_BACKREST, INI_KEY_FORMAT, undef, BACKREST_FORMAT);
$self->set(INI_SECTION_BACKREST, INI_KEY_VERSION, undef, BACKREST_VERSION);
}
@@ -265,7 +266,7 @@ sub iniSave
}
# If the value is a hash then convert it to JSON, otherwise store as is
- my $strValue = ${$oContent}{"${strSection}"}{"${strKey}"};
+ my $strValue = ${$oContent}{$strSection}{$strKey};
# If relaxed then store as old-style config
if ($bRelaxed)
@@ -322,42 +323,6 @@ sub hash
return $strHash;
}
-####################################################################################################################################
-# getBool
-#
-# Get a numeric value.
-####################################################################################################################################
-sub getBool
-{
- my $self = shift;
- my $strSection = shift;
- my $strValue = shift;
- my $strSubValue = shift;
- my $bRequired = shift;
- my $bDefault = shift;
-
- return $self->get($strSection, $strValue, $strSubValue, $bRequired,
- defined($bDefault) ? ($bDefault ? INI_TRUE : INI_FALSE) : undef) ? true : false;
-}
-
-####################################################################################################################################
-# getNumeric
-#
-# Get a numeric value.
-####################################################################################################################################
-sub getNumeric
-{
- my $self = shift;
- my $strSection = shift;
- my $strValue = shift;
- my $strSubValue = shift;
- my $bRequired = shift;
- my $nDefault = shift;
-
- return $self->get($strSection, $strValue, $strSubValue, $bRequired,
- defined($nDefault) ? $nDefault + 0 : undef) + 0;
-}
-
####################################################################################################################################
# get
#
@@ -425,35 +390,39 @@ sub get
}
####################################################################################################################################
-# setBool
+# boolGet
#
-# Set a boolean value.
+# Get a numeric value.
####################################################################################################################################
-sub setBool
+sub boolGet
{
my $self = shift;
my $strSection = shift;
- my $strKey = shift;
- my $strSubKey = shift;
- my $bValue = shift;
+ my $strValue = shift;
+ my $strSubValue = shift;
+ my $bRequired = shift;
+ my $bDefault = shift;
- $self->set($strSection, $strKey, $strSubKey, $bValue ? INI_TRUE : INI_FALSE);
+ return $self->get($strSection, $strValue, $strSubValue, $bRequired,
+ defined($bDefault) ? ($bDefault ? INI_TRUE : INI_FALSE) : undef) ? true : false;
}
####################################################################################################################################
-# setNumeric
+# numericGet
#
-# Set a numeric value.
+# Get a numeric value.
####################################################################################################################################
-sub setNumeric
+sub numericGet
{
my $self = shift;
my $strSection = shift;
- my $strKey = shift;
- my $strSubKey = shift;
- my $nValue = shift;
+ my $strValue = shift;
+ my $strSubValue = shift;
+ my $bRequired = shift;
+ my $nDefault = shift;
- $self->set($strSection, $strKey, $strSubKey, $nValue + 0);
+ return $self->get($strSection, $strValue, $strSubValue, $bRequired,
+ defined($nDefault) ? $nDefault + 0 : undef) + 0;
}
####################################################################################################################################
@@ -482,21 +451,53 @@ sub set
}
####################################################################################################################################
-# setComment
+# boolSet
#
-# Set a section comment.
+# Set a boolean value.
####################################################################################################################################
-sub setComment
+sub boolSet
{
my $self = shift;
my $strSection = shift;
- my $strComment = shift;
+ my $strKey = shift;
+ my $strSubKey = shift;
+ my $bValue = shift;
- my $oContent = $self->{oContent};
-
- ${$oContent}{$strSection}{&INI_COMMENT} = $strComment;
+ $self->set($strSection, $strKey, $strSubKey, $bValue ? INI_TRUE : INI_FALSE);
}
+####################################################################################################################################
+# numericSet
+#
+# Set a numeric value.
+####################################################################################################################################
+sub numericSet
+{
+ my $self = shift;
+ my $strSection = shift;
+ my $strKey = shift;
+ my $strSubKey = shift;
+ my $nValue = shift;
+
+ $self->set($strSection, $strKey, $strSubKey, $nValue + 0);
+}
+
+####################################################################################################################################
+# commentSet
+#
+# Set a section comment.
+####################################################################################################################################
+# sub commentSet
+# {
+# my $self = shift;
+# my $strSection = shift;
+# my $strComment = shift;
+#
+# my $oContent = $self->{oContent};
+#
+# ${$oContent}{$strSection}{&INI_COMMENT} = $strComment;
+# }
+
####################################################################################################################################
# remove
#
@@ -547,22 +548,6 @@ sub keys
return sort(keys(%{$self->{oContent}}));
}
-####################################################################################################################################
-# testBool
-#
-# Test a value to see if it equals the supplied test boolean value. If no test value is given, tests that it is defined.
-####################################################################################################################################
-sub testBool
-{
- my $self = shift;
- my $strSection = shift;
- my $strValue = shift;
- my $strSubValue = shift;
- my $bTest = shift;
-
- return $self->test($strSection, $strValue, $strSubValue, defined($bTest) ? ($bTest ? INI_TRUE : INI_FALSE) : undef);
-}
-
####################################################################################################################################
# test
#
@@ -591,4 +576,20 @@ sub test
return false;
}
+####################################################################################################################################
+# boolTest
+#
+# Test a value to see if it equals the supplied test boolean value. If no test value is given, tests that it is defined.
+####################################################################################################################################
+sub boolTest
+{
+ my $self = shift;
+ my $strSection = shift;
+ my $strValue = shift;
+ my $strSubValue = shift;
+ my $bTest = shift;
+
+ return $self->test($strSection, $strValue, $strSubValue, defined($bTest) ? ($bTest ? INI_TRUE : INI_FALSE) : undef);
+}
+
1;
diff --git a/lib/BackRest/Lock.pm b/lib/BackRest/Common/Lock.pm
similarity index 89%
rename from lib/BackRest/Lock.pm
rename to lib/BackRest/Common/Lock.pm
index 7f0765ded..d9f3edade 100644
--- a/lib/BackRest/Lock.pm
+++ b/lib/BackRest/Common/Lock.pm
@@ -1,25 +1,21 @@
####################################################################################################################################
-# LOCK MODULE
+# COMMON LOCK MODULE
####################################################################################################################################
-package BackRest::Lock;
+package BackRest::Common::Lock;
use strict;
use warnings FATAL => qw(all);
use Carp qw(confess);
use Exporter qw(import);
+ our @EXPORT = qw();
use Fcntl qw(:DEFAULT :flock);
use File::Basename qw(dirname);
use lib dirname($0) . '/../lib';
+use BackRest::Common::Exception;
+use BackRest::Common::Log;
use BackRest::Config;
-use BackRest::Exception;
-use BackRest::Utility;
-
-####################################################################################################################################
-# Exported Functions
-####################################################################################################################################
-our @EXPORT = qw(lockAcquire lockRelease);
####################################################################################################################################
# Global lock type and handle
@@ -74,7 +70,7 @@ sub lockAcquire
if (! -e lockPathName(optionGet(OPTION_REPO_PATH)))
{
mkdir (lockPathName(optionGet(OPTION_REPO_PATH)), 0770)
- or confess(ERROR, 'unable to create lock path ' . lockPathName(optionGet(OPTION_REPO_PATH)), ERROR_PATH_CREATE);
+ or confess &log(ERROR, 'unable to create lock path ' . lockPathName(optionGet(OPTION_REPO_PATH)), ERROR_PATH_CREATE);
}
# Attempt to open the lock file
@@ -103,6 +99,8 @@ sub lockAcquire
return true;
}
+push @EXPORT, qw(lockAcquire);
+
####################################################################################################################################
# lockRelease
####################################################################################################################################
@@ -131,4 +129,6 @@ sub lockRelease
undef($hCurrentLockHandle);
}
+push @EXPORT, qw(lockRelease);
+
1;
diff --git a/lib/BackRest/Utility.pm b/lib/BackRest/Common/Log.pm
similarity index 54%
rename from lib/BackRest/Utility.pm
rename to lib/BackRest/Common/Log.pm
index 8af1738fb..45bd6a8bd 100644
--- a/lib/BackRest/Utility.pm
+++ b/lib/BackRest/Common/Log.pm
@@ -1,59 +1,55 @@
####################################################################################################################################
-# UTILITY MODULE
+# COMMON LOG MODULE
####################################################################################################################################
-package BackRest::Utility;
+package BackRest::Common::Log;
use threads;
use strict;
use warnings FATAL => qw(all);
use Carp qw(confess longmess);
-use Cwd qw(abs_path);
use Exporter qw(import);
+ our @EXPORT = qw();
use Fcntl qw(:DEFAULT :flock);
-use File::Basename;
-use File::Path qw(remove_tree);
-use JSON::PP;
-use POSIX qw(ceil);
+use File::Basename qw(dirname);
+use Scalar::Util qw(blessed reftype);
use Time::HiRes qw(gettimeofday usleep);
use lib dirname($0) . '/../lib';
-use BackRest::Exception;
+use BackRest::Common::Exception;
+use BackRest::Common::String;
-our @EXPORT = qw(version_get
- data_hash_build trim common_prefix file_size_format execute
- log log_file_set log_level_set test_set test_get test_check
- hsleep wait_remainder
- timestamp_string_get timestamp_file_string_get
- TRACE DEBUG ERROR ASSERT WARN INFO OFF true false
- TEST TEST_ENCLOSE TEST_MANIFEST_BUILD TEST_BACKUP_RESUME TEST_BACKUP_NORESUME);
+####################################################################################################################################
+# Boolean constants
+####################################################################################################################################
+use constant true => 1;
+ push @EXPORT, qw(true);
+use constant false => 0;
+ push @EXPORT, qw(false);
-# Global constants
-use constant
-{
- true => 1,
- false => 0
-};
+####################################################################################################################################
+# Log level constants
+####################################################################################################################################
+use constant TRACE => 'TRACE';
+ push @EXPORT, qw(TRACE);
+use constant DEBUG => 'DEBUG';
+ push @EXPORT, qw(DEBUG);
+use constant INFO => 'INFO';
+ push @EXPORT, qw(INFO);
+use constant WARN => 'WARN';
+ push @EXPORT, qw(WARN);
+use constant ERROR => 'ERROR';
+ push @EXPORT, qw(ERROR);
+use constant ASSERT => 'ASSERT';
+ push @EXPORT, qw(ASSERT);
+use constant OFF => 'OFF';
+ push @EXPORT, qw(OFF);
-use constant
-{
- TRACE => 'TRACE',
- DEBUG => 'DEBUG',
- INFO => 'INFO',
- WARN => 'WARN',
- ERROR => 'ERROR',
- ASSERT => 'ASSERT',
- OFF => 'OFF'
-};
-
-my $hLogFile;
-my $strLogLevelFile = ERROR;
-my $strLogLevelConsole = ERROR;
+####################################################################################################################################
+# Log levels ranked by severity
+####################################################################################################################################
my %oLogLevelRank;
-my $strLockPath;
-my $hLockFile;
-
$oLogLevelRank{TRACE}{rank} = 6;
$oLogLevelRank{DEBUG}{rank} = 5;
$oLogLevelRank{INFO}{rank} = 4;
@@ -63,185 +59,35 @@ $oLogLevelRank{ASSERT}{rank} = 1;
$oLogLevelRank{OFF}{rank} = 0;
####################################################################################################################################
-# TEST Constants and Variables
+# Module globals
####################################################################################################################################
-use constant
-{
- TEST => 'TEST',
- TEST_ENCLOSE => 'PgBaCkReStTeSt',
+my $hLogFile;
+my $strLogLevelFile = ERROR;
+my $strLogLevelConsole = ERROR;
- TEST_MANIFEST_BUILD => 'MANIFEST_BUILD',
- TEST_BACKUP_RESUME => 'BACKUP_RESUME',
- TEST_BACKUP_NORESUME => 'BACKUP_NORESUME',
-};
-
-# Test global variables
+# Test globals
my $bTest = false;
my $fTestDelay;
####################################################################################################################################
-# WAIT_REMAINDER - Wait the remainder of the current second
+# Test constants
####################################################################################################################################
-sub wait_remainder
-{
- my $lTimeBegin = gettimeofday();
- my $lSleepMs = ceil(((int($lTimeBegin) + 1.05) - $lTimeBegin) * 1000);
+use constant TEST => 'TEST';
+ push @EXPORT, qw(TEST);
+use constant TEST_ENCLOSE => 'PgBaCkReStTeSt';
+ push @EXPORT, qw(TEST_ENCLOSE);
- usleep($lSleepMs * 1000);
-
- &log(TRACE, "WAIT_REMAINDER: slept ${lSleepMs}ms: begin ${lTimeBegin}, end " . gettimeofday());
-
- return int($lTimeBegin);
-}
+use constant TEST_MANIFEST_BUILD => 'MANIFEST_BUILD';
+ push @EXPORT, qw(TEST_MANIFEST_BUILD);
+use constant TEST_BACKUP_RESUME => 'BACKUP_RESUME';
+ push @EXPORT, qw(TEST_BACKUP_RESUME);
+use constant TEST_BACKUP_NORESUME => 'BACKUP_NORESUME';
+ push @EXPORT, qw(TEST_BACKUP_NORESUME);
####################################################################################################################################
-# DATA_HASH_BUILD - Hash a delimited file with header
+# logFileSet - set the file messages will be logged to
####################################################################################################################################
-sub data_hash_build
-{
- my $oHashRef = shift;
- my $strData = shift;
- my $strDelimiter = shift;
- my $strUndefinedKey = shift;
-
- my @stryFile = split("\n", $strData);
- my @stryHeader = split($strDelimiter, $stryFile[0]);
-
- for (my $iLineIdx = 1; $iLineIdx < scalar @stryFile; $iLineIdx++)
- {
- my @stryLine = split($strDelimiter, $stryFile[$iLineIdx]);
-
- if (!defined($stryLine[0]) || $stryLine[0] eq '')
- {
- $stryLine[0] = $strUndefinedKey;
- }
-
- for (my $iColumnIdx = 1; $iColumnIdx < scalar @stryHeader; $iColumnIdx++)
- {
- if (defined(${$oHashRef}{"$stryHeader[0]"}{"$stryLine[0]"}{"$stryHeader[$iColumnIdx]"}))
- {
- confess 'the first column must be unique to build the hash';
- }
-
- if (defined($stryLine[$iColumnIdx]) && $stryLine[$iColumnIdx] ne '')
- {
- ${$oHashRef}{"$stryHeader[0]"}{"$stryLine[0]"}{"$stryHeader[$iColumnIdx]"} = $stryLine[$iColumnIdx];
- }
- }
- }
-}
-
-####################################################################################################################################
-# TRIM - trim whitespace off strings
-####################################################################################################################################
-sub trim
-{
- my $strBuffer = shift;
-
- if (!defined($strBuffer))
- {
- return undef;
- }
-
- $strBuffer =~ s/^\s+|\s+$//g;
-
- return $strBuffer;
-}
-
-####################################################################################################################################
-# hsleep - wrapper for usleep that takes seconds in fractions and returns time slept in ms
-####################################################################################################################################
-sub hsleep
-{
- my $fSecond = shift;
-
- return usleep($fSecond * 1000000);
-}
-
-####################################################################################################################################
-# COMMON_PREFIX
-####################################################################################################################################
-sub common_prefix
-{
- my $strString1 = shift;
- my $strString2 = shift;
-
- my $iCommonLen = 0;
- my $iCompareLen = length($strString1) < length($strString2) ? length($strString1) : length($strString2);
-
- for (my $iIndex = 0; $iIndex < $iCompareLen; $iIndex++)
- {
- if (substr($strString1, $iIndex, 1) ne substr($strString2, $iIndex, 1))
- {
- last;
- }
-
- $iCommonLen++;
- }
-
- return $iCommonLen;
-}
-
-####################################################################################################################################
-# FILE_SIZE_FORMAT - Format file sizes in human-readable form
-####################################################################################################################################
-sub file_size_format
-{
- my $lFileSize = shift;
-
- if ($lFileSize < 1024)
- {
- return $lFileSize . 'B';
- }
-
- if ($lFileSize < (1024 * 1024))
- {
- return (int($lFileSize / 102.4) / 10) . 'KB';
- }
-
- if ($lFileSize < (1024 * 1024 * 1024))
- {
- return (int($lFileSize / 1024 / 102.4) / 10) . 'MB';
- }
-
- return (int($lFileSize / 1024 / 1024 / 102.4) / 10) . 'GB';
-}
-
-####################################################################################################################################
-# TIMESTAMP_STRING_GET - Get standard timestamp (or formatted as specified)
-####################################################################################################################################
-sub timestamp_string_get
-{
- my $strFormat = shift;
- my $lTime = shift;
-
- if (!defined($strFormat))
- {
- $strFormat = '%4d-%02d-%02d %02d:%02d:%02d';
- }
-
- if (!defined($lTime))
- {
- $lTime = time();
- }
-
- my ($iSecond, $iMinute, $iHour, $iMonthDay, $iMonth, $iYear, $iWeekDay, $iYearDay, $bIsDst) = localtime($lTime);
-
- return sprintf($strFormat, $iYear + 1900, $iMonth + 1, $iMonthDay, $iHour, $iMinute, $iSecond);
-}
-
-####################################################################################################################################
-# TIMESTAMP_FILE_STRING_GET - Get the date and time string formatted for filenames
-####################################################################################################################################
-sub timestamp_file_string_get
-{
- return timestamp_string_get('%4d%02d%02d-%02d%02d%02d');
-}
-
-####################################################################################################################################
-# LOG_FILE_SET - set the file messages will be logged to
-####################################################################################################################################
-sub log_file_set
+sub logFileSet
{
my $strFile = shift;
@@ -251,7 +97,7 @@ sub log_file_set
or die "unable to create directory for log file ${strFile}";
}
- $strFile .= '-' . timestamp_string_get('%4d%02d%02d') . '.log';
+ $strFile .= '-' . timestampFormat('%4d%02d%02d') . '.log';
my $bExists = false;
if (-e $strFile)
@@ -270,43 +116,12 @@ sub log_file_set
syswrite($hLogFile, "-------------------PROCESS START-------------------\n");
}
-####################################################################################################################################
-# TEST_SET - set test parameters
-####################################################################################################################################
-sub test_set
-{
- my $bTestParam = shift;
- my $fTestDelayParam = shift;
-
- # Set defaults
- $bTest = defined($bTestParam) ? $bTestParam : false;
- $fTestDelay = defined($bTestParam) ? $fTestDelayParam : $fTestDelay;
-
- # Make sure that a delay is specified in test mode
- if ($bTest && !defined($fTestDelay))
- {
- confess &log(ASSERT, 'iTestDelay must be provided when bTest is true');
- }
-
- # Test delay should be between 1 and 600 seconds
- if (!($fTestDelay >= 0 && $fTestDelay <= 600))
- {
- confess &log(ERROR, 'test-delay must be between 1 and 600 seconds');
- }
-}
+push @EXPORT, qw(logFileSet);
####################################################################################################################################
-# TEST_GET - are we in test mode?
+# logLevelSet - set the log level for file and console
####################################################################################################################################
-sub test_get
-{
- return $bTest;
-}
-
-####################################################################################################################################
-# LOG_LEVEL_SET - set the log level for file and console
-####################################################################################################################################
-sub log_level_set
+sub logLevelSet
{
my $strLevelFileParam = shift;
my $strLevelConsoleParam = shift;
@@ -332,30 +147,178 @@ sub log_level_set
}
}
-####################################################################################################################################
-# TEST_CHECK - Check for a test message
-####################################################################################################################################
-sub test_check
-{
- my $strLog = shift;
- my $strTest = shift;
+push @EXPORT, qw(logLevelSet);
- return index($strLog, TEST_ENCLOSE . '-' . $strTest . '-' . TEST_ENCLOSE) != -1;
+####################################################################################################################################
+# logDebugParam
+#
+# Log parameters passed to functions.
+####################################################################################################################################
+use constant DEBUG_PARAM => '()';
+
+sub logDebugParam
+{
+ my $strFunction = shift;
+ my $oyParamRef = shift;
+
+ return logDebugProcess($strFunction, DEBUG_PARAM, undef, $oyParamRef, @_);
+}
+
+push @EXPORT, qw(logDebugParam);
+
+####################################################################################################################################
+# logDebugReturn
+#
+# Log values returned from functions.
+####################################################################################################################################
+use constant DEBUG_RETURN => '=>';
+
+sub logDebugReturn
+{
+ my $strFunction = shift;
+
+ return logDebugProcess($strFunction, DEBUG_RETURN, undef, undef, @_);
+}
+
+push @EXPORT, qw(logDebugReturn);
+
+####################################################################################################################################
+# logDebugMisc
+#
+# Log misc values and details during execution.
+####################################################################################################################################
+use constant DEBUG_MISC => '';
+
+sub logDebugMisc
+{
+ my $strFunction = shift;
+ my $strDetail = shift;
+
+ return logDebugProcess($strFunction, DEBUG_MISC, $strDetail, undef, @_);
+}
+
+push @EXPORT, qw(logDebugMisc);
+
+####################################################################################################################################
+# logDebugProcess
+####################################################################################################################################
+sub logDebugProcess
+{
+ my $strFunction = shift;
+ my $strType = shift;
+ my $strDetail = shift;
+ my $oyParamRef = shift;
+
+ my $iIndex = 0;
+ my $oParamHash = {};
+ my @oyResult;
+ my $bLogTrace = true;
+
+ if ($strType eq DEBUG_PARAM)
+ {
+ push @oyResult, $strFunction;
+ }
+
+ # Process each parameter hash
+ my $oParam = shift;
+
+ while (defined($oParam))
+ {
+ my $strParamName = $$oParam{name};
+ my $oValue;
+
+ # Push the return value into the return value array
+ if ($strType eq DEBUG_PARAM)
+ {
+ if (defined($$oyParamRef[$iIndex]))
+ {
+ push(@oyResult, $$oyParamRef[$iIndex]);
+ }
+ else
+ {
+ push(@oyResult, $${oParam}{default});
+ $$oParamHash{$strParamName}{default} = true;
+ }
+
+ $oValue = $oyResult[@oyResult - 1];
+
+ if (!defined($oValue) && (!defined($${oParam}{required}) || $${oParam}{required}))
+ {
+ confess &log(ASSERT, "${strParamName} is required in ${strFunction}");
+ }
+ }
+ else
+ {
+ if (ref($$oParam{value}) eq 'ARRAY')
+ {
+ if (defined($$oParam{ref}) && $$oParam{ref})
+ {
+ push(@oyResult, $$oParam{value});
+ }
+ else
+ {
+ push(@oyResult, @{$$oParam{value}});
+ }
+ }
+ else
+ {
+ push(@oyResult, $$oParam{value});
+ }
+
+ $oValue = $$oParam{value};
+ }
+
+ if (!defined($$oParam{log}) || $$oParam{log})
+ {
+
+ # If the parameter is a hash but not blessed then represent it as a string
+ # !!! This should go away once the inputs to logDebug can be changed
+ if (ref($oValue) eq 'HASH' && !blessed($oValue))
+ {
+ $$oParamHash{$strParamName}{value} = '[hash]';
+ }
+ # Else log the parameter value exactly
+ else
+ {
+ $$oParamHash{$strParamName}{value} = $oValue;
+ }
+
+ # There are certain return values that it's wasteful to generate debug logging for
+ if (!($strParamName eq 'self') &&
+ (!defined($$oParam{trace}) || !$$oParam{trace}))
+ {
+ $bLogTrace = false;
+ }
+ }
+
+ # Get the next parameter hash
+ $oParam = shift;
+ $iIndex++;
+ }
+
+ if (defined($strDetail) && $iIndex == 0)
+ {
+ $bLogTrace = false;
+ }
+
+ logDebugOut($strFunction, $strType, $strDetail, $oParamHash, $bLogTrace ? TRACE : DEBUG);
+
+ # If there are one or zero return values then just return a scalar (this will be undef if there are no return values)
+ if (@oyResult == 1)
+ {
+ return $oyResult[0];
+ }
+
+ # Else return an array containing return values
+ return @oyResult;
}
####################################################################################################################################
-# logDebug
+# logDebugOut
####################################################################################################################################
-use constant DEBUG_CALL => '()';
- push @EXPORT, qw(DEBUG_CALL);
-use constant DEBUG_RESULT => '=>';
- push @EXPORT, qw(DEBUG_RESULT);
-use constant DEBUG_MISC => '';
- push @EXPORT, qw(DEBUG_MISC);
-
use constant DEBUG_STRING_MAX_LEN => 1024;
-sub logDebug
+sub logDebugOut
{
my $strFunction = shift;
my $strType = shift;
@@ -379,19 +342,55 @@ sub logDebug
$strParamSet .= ', ';
}
- my $strValueRef = ref($$oParamHash{$strParam}) ? $$oParamHash{$strParam} : \$$oParamHash{$strParam};
+ my $strValueRef;
+ my $bDefault = false;
+
+ if (ref($$oParamHash{$strParam}) eq 'HASH')
+ {
+ if (blessed($$oParamHash{$strParam}{value}))
+ {
+ $strValueRef = \'[object]';
+ }
+ else
+ {
+ if (ref($$oParamHash{$strParam}{value}) eq 'ARRAY')
+ {
+ $strValueRef = \('(' . join(', ', @{$$oParamHash{$strParam}{value}}) . ')');
+ }
+ else
+ {
+ $strValueRef = ref($$oParamHash{$strParam}{value}) ? $$oParamHash{$strParam}{value} :
+ \$$oParamHash{$strParam}{value};
+
+ $bDefault = defined($$strValueRef) &&
+ defined($$oParamHash{$strParam}{default}) ? $$oParamHash{$strParam}{default} : false;
+ }
+ }
+ }
+ # If this is an ARRAY ref then create a comma-separated list
+ elsif (ref($$oParamHash{$strParam}) eq 'ARRAY')
+ {
+ $strValueRef = \(join(', ', @{$$oParamHash{$strParam}}));
+ }
+ # Else get a reference if a reference was not passed
+ else
+ {
+ $strValueRef = ref($$oParamHash{$strParam}) ? $$oParamHash{$strParam} : \$$oParamHash{$strParam};
+ }
$strParamSet .= "${strParam} = " .
+ ($bDefault ? '<' : '') .
(defined($$strValueRef) ?
- ($strParam =~ /^is/ ? ($$strValueRef ? 'true' : 'false'):
+ ($strParam =~ /^(b|is)/ ? ($$strValueRef ? 'true' : 'false'):
(length($$strValueRef) > DEBUG_STRING_MAX_LEN ?
- substr($$strValueRef, 0, DEBUG_STRING_MAX_LEN) . ' ... [TRUNCATED]':
- $$strValueRef)) : '[undef]');
+ substr($$strValueRef, 0, DEBUG_STRING_MAX_LEN) . ' ... ':
+ $$strValueRef)) : '[undef]') .
+ ($bDefault ? '>' : '');
}
if (defined($strMessage))
{
- $strMessage = "${strMessage}: ${strParamSet}";
+ $strMessage = $strMessage . (defined($strParamSet) ? ": ${strParamSet}" : '');
}
else
{
@@ -403,24 +402,6 @@ sub logDebug
}
}
-push @EXPORT, qw(logDebug);
-
-sub logTrace
-{
- my $strFunction = shift;
- my $strType = shift;
- my $strMessage = shift;
- my $oParamHash = shift;
-
- if ($oLogLevelRank{&TRACE}{rank} <= $oLogLevelRank{$strLogLevelConsole}{rank} ||
- $oLogLevelRank{&TRACE}{rank} <= $oLogLevelRank{$strLogLevelFile}{rank})
- {
- logDebug($strFunction, $strType, $strMessage, $oParamHash, TRACE);
- }
-}
-
-push @EXPORT, qw(logTrace);
-
####################################################################################################################################
# LOG - log messages
####################################################################################################################################
@@ -484,7 +465,7 @@ sub log
# Format the message text
my ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday, $isdst) = localtime(time);
- $strMessageFormat = timestamp_string_get() . sprintf('.%03d T%02d', (gettimeofday() - int(gettimeofday())) * 1000,
+ $strMessageFormat = timestampFormat() . sprintf('.%03d T%02d', (gettimeofday() - int(gettimeofday())) * 1000,
threads->tid()) .
(' ' x (7 - length($strLevel))) . "${strLevel}: ${strMessageFormat}\n";
@@ -500,7 +481,7 @@ sub log
# If in test mode and this is a test messsage then delay so the calling process has time to read the message
if ($bTest && $strLevel eq TEST && $fTestDelay > 0)
{
- hsleep($fTestDelay);
+ usleep($fTestDelay * 1000000);
}
}
@@ -528,127 +509,55 @@ sub log
# Throw a typed exception if code is defined
if (defined($iCode))
{
- return new BackRest::Exception($iCode, $strMessage, longmess());
+ return new BackRest::Common::Exception($iCode, $strMessage, longmess());
}
# Return the message test so it can be used in a confess
return $strMessage;
}
-####################################################################################################################################
-####################################################################################################################################
-# Wait Functions
-####################################################################################################################################
-####################################################################################################################################
-push @EXPORT, qw(waitInit waitMore waitInterval);
+push @EXPORT, qw(log);
####################################################################################################################################
-# waitInit
+# testSet
+#
+# Set test parameters.
####################################################################################################################################
-sub waitInit
+sub testSet
{
- my $fWaitTime = shift;
- my $fSleep = shift;
+ my $bTestParam = shift;
+ my $fTestDelayParam = shift;
- # Declare oWait hash
- my $oWait = {};
+ # Set defaults
+ $bTest = defined($bTestParam) ? $bTestParam : false;
+ $fTestDelay = defined($bTestParam) ? $fTestDelayParam : $fTestDelay;
- # If wait seconds is not defined or 0 then return undef
- if (!defined($fWaitTime) || $fWaitTime == 0)
+ # Make sure that a delay is specified in test mode
+ if ($bTest && !defined($fTestDelay))
{
- return undef;
+ confess &log(ASSERT, 'iTestDelay must be provided when bTest is true');
}
- # Wait seconds can be a minimum of .1
- if ($fWaitTime < .1)
+ # Test delay should be between 1 and 600 seconds
+ if (!($fTestDelay >= 0 && $fTestDelay <= 600))
{
- confess &log(ASSERT, 'fWaitTime cannot be < .1');
+ confess &log(ERROR, 'test-delay must be between 1 and 600 seconds');
}
-
- # If fSleep is not defined set it
- if (!defined($fSleep))
- {
- if ($fWaitTime >= 1)
- {
- $$oWait{sleep} = .1;
- }
- else
- {
- $$oWait{sleep} = $fWaitTime / 10;
- }
- }
- # Else make sure it's not greater than fWaitTime
- else
- {
- # Make sure fsleep is less than fWaitTime
- if ($fSleep >= $fWaitTime)
- {
- confess &log(ASSERT, 'fSleep > fWaitTime - this is useless');
- }
- }
-
- # Set variables
- $$oWait{wait_time} = $fWaitTime;
- $$oWait{time_begin} = gettimeofday();
- $$oWait{time_end} = $$oWait{time_begin};
-
- return $oWait;
}
+push @EXPORT, qw(testSet);
+
####################################################################################################################################
-# waitMore
+# testCheck - Check for a test message
####################################################################################################################################
-sub waitMore
+sub testCheck
{
- my $oWait = shift;
+ my $strLog = shift;
+ my $strTest = shift;
- # Return if oWait is not defined
- if (!defined($oWait))
- {
- return false;
- }
-
- # Sleep for fSleep time
- hsleep($$oWait{sleep});
-
- # Capture the end time
- $$oWait{time_end} = gettimeofday();
-
- # Exit if wait time has expired
- if ((gettimeofday() - $$oWait{time_begin}) < $$oWait{wait_time})
- {
- return true;
- }
-
- # Else calculate the new sleep time
- my $fSleepNext = $$oWait{sleep} + (defined($$oWait{sleep_prev}) ? $$oWait{sleep_prev} : 0);
-
- if ($fSleepNext > $$oWait{wait_time} - ($$oWait{time_end} - $$oWait{time_begin}))
- {
- $fSleepNext = ($$oWait{wait_time} - ($$oWait{time_end} - $$oWait{time_begin})) + .001
- }
-
- $$oWait{sleep_prev} = $$oWait{sleep};
- $$oWait{sleep} = $fSleepNext;
-
- return false;
+ return index($strLog, TEST_ENCLOSE . '-' . $strTest . '-' . TEST_ENCLOSE) != -1;
}
-
-####################################################################################################################################
-# waitInterval
-####################################################################################################################################
-sub waitInterval
-{
- my $oWait = shift;
-
- # Error if oWait is not defined
- if (!defined($oWait))
- {
- confess &log("fWaitTime was not defined in waitInit");
- }
-
- return int(($$oWait{time_end} - $$oWait{time_begin}) * 1000) / 1000;
-}
+push @EXPORT, qw(testCheck);
1;
diff --git a/lib/BackRest/Common/String.pm b/lib/BackRest/Common/String.pm
new file mode 100644
index 000000000..a048eee34
--- /dev/null
+++ b/lib/BackRest/Common/String.pm
@@ -0,0 +1,190 @@
+####################################################################################################################################
+# COMMON STRING MODULE
+####################################################################################################################################
+package BackRest::Common::String;
+
+use threads;
+use strict;
+use warnings FATAL => qw(all);
+use Carp qw(confess longmess);
+
+use Exporter qw(import);
+ our @EXPORT = qw();
+use File::Basename qw(dirname);
+
+####################################################################################################################################
+# dataHashBuild
+#
+# Hash a delimited multi-line string with a header.
+####################################################################################################################################
+sub dataHashBuild
+{
+ my $oHashRef = shift;
+ my $strData = shift;
+ my $strDelimiter = shift;
+ my $strUndefinedKey = shift;
+
+ my @stryFile = split("\n", $strData);
+ my @stryHeader = split($strDelimiter, $stryFile[0]);
+
+ for (my $iLineIdx = 1; $iLineIdx < scalar @stryFile; $iLineIdx++)
+ {
+ my @stryLine = split($strDelimiter, $stryFile[$iLineIdx]);
+
+ if (!defined($stryLine[0]) || $stryLine[0] eq '')
+ {
+ $stryLine[0] = $strUndefinedKey;
+ }
+
+ for (my $iColumnIdx = 1; $iColumnIdx < scalar @stryHeader; $iColumnIdx++)
+ {
+ if (defined(${$oHashRef}{"$stryHeader[0]"}{"$stryLine[0]"}{"$stryHeader[$iColumnIdx]"}))
+ {
+ confess 'the first column must be unique to build the hash';
+ }
+
+ if (defined($stryLine[$iColumnIdx]) && $stryLine[$iColumnIdx] ne '')
+ {
+ ${$oHashRef}{"$stryHeader[0]"}{"$stryLine[0]"}{"$stryHeader[$iColumnIdx]"} = $stryLine[$iColumnIdx];
+ }
+ }
+ }
+}
+
+push @EXPORT, qw(dataHashBuild);
+
+####################################################################################################################################
+# trim
+#
+# Trim whitespace.
+####################################################################################################################################
+sub trim
+{
+ my $strBuffer = shift;
+
+ if (!defined($strBuffer))
+ {
+ return undef;
+ }
+
+ $strBuffer =~ s/^\s+|\s+$//g;
+
+ return $strBuffer;
+}
+
+push @EXPORT, qw(trim);
+
+####################################################################################################################################
+# commonPrefix
+#
+# Determine how much of two strings is the same from the beginning.
+####################################################################################################################################
+sub commonPrefix
+{
+ my $strString1 = shift;
+ my $strString2 = shift;
+
+ my $iCommonLen = 0;
+ my $iCompareLen = length($strString1) < length($strString2) ? length($strString1) : length($strString2);
+
+ for (my $iIndex = 0; $iIndex < $iCompareLen; $iIndex++)
+ {
+ if (substr($strString1, $iIndex, 1) ne substr($strString2, $iIndex, 1))
+ {
+ last;
+ }
+
+ $iCommonLen++;
+ }
+
+ return $iCommonLen;
+}
+
+push @EXPORT, qw(commonPrefix);
+
+####################################################################################################################################
+# boolFormat
+#
+# Outut boolean as true or false.
+####################################################################################################################################
+sub boolFormat
+{
+ my $bValue;
+
+ if ($bValue)
+ {
+ return 'true';
+ }
+
+ return 'false';
+}
+
+push @EXPORT, qw(boolFormat);
+
+####################################################################################################################################
+# fileSizeFormat
+#
+# Format file sizes in human-readable form.
+####################################################################################################################################
+sub fileSizeFormat
+{
+ my $lFileSize = shift;
+
+ if ($lFileSize < 1024)
+ {
+ return $lFileSize . 'B';
+ }
+
+ if ($lFileSize < (1024 * 1024))
+ {
+ return (int($lFileSize / 102.4) / 10) . 'KB';
+ }
+
+ if ($lFileSize < (1024 * 1024 * 1024))
+ {
+ return (int($lFileSize / 1024 / 102.4) / 10) . 'MB';
+ }
+
+ return (int($lFileSize / 1024 / 1024 / 102.4) / 10) . 'GB';
+}
+
+push @EXPORT, qw(fileSizeFormat);
+
+####################################################################################################################################
+# timestampFormat
+#
+# Get standard timestamp format (or formatted as specified).
+####################################################################################################################################
+sub timestampFormat
+{
+ my $strFormat = shift;
+ my $lTime = shift;
+
+ if (!defined($strFormat))
+ {
+ $strFormat = '%4d-%02d-%02d %02d:%02d:%02d';
+ }
+
+ if (!defined($lTime))
+ {
+ $lTime = time();
+ }
+
+ my ($iSecond, $iMinute, $iHour, $iMonthDay, $iMonth, $iYear, $iWeekDay, $iYearDay, $bIsDst) = localtime($lTime);
+
+ return sprintf($strFormat, $iYear + 1900, $iMonth + 1, $iMonthDay, $iHour, $iMinute, $iSecond);
+}
+
+push @EXPORT, qw(timestampFormat);
+
+####################################################################################################################################
+# timestampFileFormat
+####################################################################################################################################
+sub timestampFileFormat
+{
+ return timestampFormat('%4d%02d%02d-%02d%02d%02d');
+}
+
+push @EXPORT, qw(timestampFileFormat);
+
+1;
diff --git a/lib/BackRest/Common/Wait.pm b/lib/BackRest/Common/Wait.pm
new file mode 100644
index 000000000..8068dd3ce
--- /dev/null
+++ b/lib/BackRest/Common/Wait.pm
@@ -0,0 +1,163 @@
+####################################################################################################################################
+# COMMON WAIT MODULE
+####################################################################################################################################
+package BackRest::Common::Wait;
+
+use threads;
+use strict;
+use warnings FATAL => qw(all);
+use Carp qw(confess);
+
+use Exporter qw(import);
+ our @EXPORT = qw();
+use File::Basename qw(dirname);
+use POSIX qw(ceil);
+use Time::HiRes qw(gettimeofday usleep);
+
+use lib dirname($0) . '/../lib';
+use BackRest::Common::Log;
+
+####################################################################################################################################
+# waitRemainder
+####################################################################################################################################
+sub waitRemainder
+{
+ my $lTimeBegin = gettimeofday();
+ my $lSleepMs = ceil(((int($lTimeBegin) + 1.05) - $lTimeBegin) * 1000);
+
+ usleep($lSleepMs * 1000);
+
+ &log(TRACE, "WAIT_REMAINDER: slept ${lSleepMs}ms: begin ${lTimeBegin}, end " . gettimeofday());
+
+ return int($lTimeBegin);
+}
+
+push @EXPORT, qw(waitRemainder);
+
+####################################################################################################################################
+# waitHiRes
+####################################################################################################################################
+sub waitHiRes
+{
+ my $fSecond = shift;
+
+ return usleep($fSecond * 1000000);
+}
+
+push @EXPORT, qw(waitHiRes);
+
+####################################################################################################################################
+# waitInit
+####################################################################################################################################
+sub waitInit
+{
+ my $fWaitTime = shift;
+ my $fSleep = shift;
+
+ # Declare oWait hash
+ my $oWait = {};
+
+ # If wait seconds is not defined or 0 then return undef
+ if (!defined($fWaitTime) || $fWaitTime == 0)
+ {
+ return undef;
+ }
+
+ # Wait seconds can be a minimum of .1
+ if ($fWaitTime < .1)
+ {
+ confess &log(ASSERT, 'fWaitTime cannot be < .1');
+ }
+
+ # If fSleep is not defined set it
+ if (!defined($fSleep))
+ {
+ if ($fWaitTime >= 1)
+ {
+ $$oWait{sleep} = .1;
+ }
+ else
+ {
+ $$oWait{sleep} = $fWaitTime / 10;
+ }
+ }
+ # Else make sure it's not greater than fWaitTime
+ else
+ {
+ # Make sure fsleep is less than fWaitTime
+ if ($fSleep >= $fWaitTime)
+ {
+ confess &log(ASSERT, 'fSleep > fWaitTime - this is useless');
+ }
+ }
+
+ # Set variables
+ $$oWait{wait_time} = $fWaitTime;
+ $$oWait{time_begin} = gettimeofday();
+ $$oWait{time_end} = $$oWait{time_begin};
+
+ return $oWait;
+}
+
+push @EXPORT, qw(waitInit);
+
+####################################################################################################################################
+# waitMore
+####################################################################################################################################
+sub waitMore
+{
+ my $oWait = shift;
+
+ # Return if oWait is not defined
+ if (!defined($oWait))
+ {
+ return false;
+ }
+
+ # Sleep for fSleep time
+ waitHiRes($$oWait{sleep});
+
+ # Capture the end time
+ $$oWait{time_end} = gettimeofday();
+
+ # Exit if wait time has expired
+ if ((gettimeofday() - $$oWait{time_begin}) < $$oWait{wait_time})
+ {
+ return true;
+ }
+
+ # Else calculate the new sleep time
+ my $fSleepNext = $$oWait{sleep} + (defined($$oWait{sleep_prev}) ? $$oWait{sleep_prev} : 0);
+
+ if ($fSleepNext > $$oWait{wait_time} - ($$oWait{time_end} - $$oWait{time_begin}))
+ {
+ $fSleepNext = ($$oWait{wait_time} - ($$oWait{time_end} - $$oWait{time_begin})) + .001
+ }
+
+ $$oWait{sleep_prev} = $$oWait{sleep};
+ $$oWait{sleep} = $fSleepNext;
+
+ return false;
+}
+
+push @EXPORT, qw(waitMore);
+
+####################################################################################################################################
+# waitInterval
+####################################################################################################################################
+sub waitInterval
+{
+ my $oWait = shift;
+
+ # Error if oWait is not defined
+ if (!defined($oWait))
+ {
+ confess &log(ERROR, "oWait is not defined");
+ }
+
+ return int(($$oWait{time_end} - $$oWait{time_begin}) * 1000) / 1000;
+}
+
+push @EXPORT, qw(waitInterval);
+
+1;
diff --git a/lib/BackRest/Config.pm b/lib/BackRest/Config.pm
index f824b535a..6feb8d1cb 100644
--- a/lib/BackRest/Config.pm
+++ b/lib/BackRest/Config.pm
@@ -9,22 +9,16 @@ use Carp qw(confess);
use Cwd qw(abs_path);
use Exporter qw(import);
+ our @EXPORT = qw();
use File::Basename qw(dirname basename);
use Getopt::Long qw(GetOptions);
use lib dirname($0) . '/../lib';
-use BackRest::Exception;
-use BackRest::Ini;
+use BackRest::Common::Exception;
+use BackRest::Common::Ini;
+use BackRest::Common::Log;
use BackRest::Protocol::Common;
use BackRest::Protocol::RemoteMaster;
-use BackRest::Utility;
-
-####################################################################################################################################
-# Export functions
-####################################################################################################################################
-our @EXPORT = qw(configLoad optionGet optionTest optionRuleGet optionRequired optionDefault commandGet commandTest
- commandSet commandWrite optionRemoteType optionRemoteTypeTest protocolGet optionRemoteTest
- protocolDestroy);
####################################################################################################################################
# BackRest executable name used for help messages and default
@@ -35,14 +29,12 @@ use constant BACKREST_EXE => basename(
####################################################################################################################################
# DB/BACKUP Constants
####################################################################################################################################
-use constant
-{
- DB => 'db',
- BACKUP => 'backup',
- NONE => 'none'
-};
-
-push @EXPORT, qw(DB BACKUP NONE);
+use constant DB => 'db';
+ push @EXPORT, qw(DB);
+use constant BACKUP => 'backup';
+ push @EXPORT, qw(BACKUP);
+use constant NONE => 'none';
+ push @EXPORT, qw(NONE);
####################################################################################################################################
# Command constants - basic commands that are allowed in backrest
@@ -65,14 +57,12 @@ use constant CMD_EXPIRE => 'expire';
####################################################################################################################################
# BACKUP Type Constants
####################################################################################################################################
-use constant
-{
- BACKUP_TYPE_FULL => 'full',
- BACKUP_TYPE_DIFF => 'diff',
- BACKUP_TYPE_INCR => 'incr'
-};
-
-push @EXPORT, qw(BACKUP_TYPE_FULL BACKUP_TYPE_DIFF BACKUP_TYPE_INCR);
+use constant BACKUP_TYPE_FULL => 'full';
+ push @EXPORT, qw(BACKUP_TYPE_FULL);
+use constant BACKUP_TYPE_DIFF => 'diff';
+ push @EXPORT, qw(BACKUP_TYPE_DIFF);
+use constant BACKUP_TYPE_INCR => 'incr';
+ push @EXPORT, qw(BACKUP_TYPE_INCR);
####################################################################################################################################
# INFO Output Constants
@@ -85,272 +75,377 @@ use constant INFO_OUTPUT_JSON => 'json';
####################################################################################################################################
# SOURCE Constants
####################################################################################################################################
-use constant
-{
- SOURCE_CONFIG => 'config',
- SOURCE_PARAM => 'param',
- SOURCE_DEFAULT => 'default'
-};
+use constant SOURCE_CONFIG => 'config';
+use constant SOURCE_PARAM => 'param';
+use constant SOURCE_DEFAULT => 'default';
####################################################################################################################################
# RECOVERY Type Constants
####################################################################################################################################
-use constant
-{
- RECOVERY_TYPE_NAME => 'name',
- RECOVERY_TYPE_TIME => 'time',
- RECOVERY_TYPE_XID => 'xid',
- RECOVERY_TYPE_PRESERVE => 'preserve',
- RECOVERY_TYPE_NONE => 'none',
- RECOVERY_TYPE_DEFAULT => 'default'
-};
-
-push @EXPORT, qw(RECOVERY_TYPE_NAME RECOVERY_TYPE_TIME RECOVERY_TYPE_XID RECOVERY_TYPE_PRESERVE RECOVERY_TYPE_NONE
- RECOVERY_TYPE_DEFAULT);
-
-####################################################################################################################################
-# Configuration section constants
-####################################################################################################################################
-use constant
-{
- CONFIG_GLOBAL => 'global',
-
- CONFIG_SECTION_ARCHIVE => 'archive',
- CONFIG_SECTION_BACKUP => 'backup',
- CONFIG_SECTION_COMMAND => 'command',
- CONFIG_SECTION_GENERAL => 'general',
- CONFIG_SECTION_LOG => 'log',
- CONFIG_SECTION_RESTORE_RECOVERY_SETTING => 'restore:recovery-setting',
- CONFIG_SECTION_RESTORE_TABLESPACE_MAP => 'restore:tablespace-map',
- CONFIG_SECTION_EXPIRE => 'expire',
- CONFIG_SECTION_STANZA => 'stanza'
-};
-
-push @EXPORT, qw(CONFIG_GLOBAL
-
- CONFIG_SECTION_ARCHIVE CONFIG_SECTION_BACKUP CONFIG_SECTION_COMMAND
- CONFIG_SECTION_GENERAL CONFIG_SECTION_LOG CONFIG_SECTION_RESTORE_RECOVERY_SETTING
- CONFIG_SECTION_EXPIRE CONFIG_SECTION_STANZA CONFIG_SECTION_RESTORE_TABLESPACE_MAP);
-
-####################################################################################################################################
-# Option constants
-####################################################################################################################################
-use constant
-{
- # Command-line-only options
- OPTION_CONFIG => 'config',
- OPTION_DELTA => 'delta',
- OPTION_FORCE => 'force',
- OPTION_NO_START_STOP => 'no-start-stop',
- OPTION_SET => 'set',
- OPTION_STANZA => 'stanza',
- OPTION_TARGET => 'target',
- OPTION_TARGET_EXCLUSIVE => 'target-exclusive',
- OPTION_TARGET_RESUME => 'target-resume',
- OPTION_TARGET_TIMELINE => 'target-timeline',
- OPTION_TYPE => 'type',
- OPTION_OUTPUT => 'output',
-
- # Command-line/conf file options
- # GENERAL Section
- OPTION_BUFFER_SIZE => 'buffer-size',
- OPTION_DB_TIMEOUT => 'db-timeout',
- OPTION_COMPRESS => 'compress',
- OPTION_COMPRESS_LEVEL => 'compress-level',
- OPTION_COMPRESS_LEVEL_NETWORK => 'compress-level-network',
- OPTION_NEUTRAL_UMASK => 'neutral-umask',
- OPTION_REPO_PATH => 'repo-path',
- OPTION_REPO_REMOTE_PATH => 'repo-remote-path',
- OPTION_THREAD_MAX => 'thread-max',
- OPTION_THREAD_TIMEOUT => 'thread-timeout',
-
- # ARCHIVE Section
- OPTION_ARCHIVE_MAX_MB => 'archive-max-mb',
- OPTION_ARCHIVE_ASYNC => 'archive-async',
-
- # BACKUP Section
- OPTION_BACKUP_ARCHIVE_CHECK => 'archive-check',
- OPTION_BACKUP_ARCHIVE_COPY => 'archive-copy',
- OPTION_BACKUP_HOST => 'backup-host',
- OPTION_BACKUP_USER => 'backup-user',
- OPTION_HARDLINK => 'hardlink',
- OPTION_MANIFEST_SAVE_THRESHOLD => 'manifest-save-threshold',
- OPTION_RESUME => 'resume',
- OPTION_STOP_AUTO => 'stop-auto',
- OPTION_START_FAST => 'start-fast',
-
- # COMMAND Section
- OPTION_COMMAND_REMOTE => 'cmd-remote',
-
- # LOG Section
- OPTION_LOG_LEVEL_CONSOLE => 'log-level-console',
- OPTION_LOG_LEVEL_FILE => 'log-level-file',
-
- # EXPIRE Section
- OPTION_RETENTION_ARCHIVE => 'retention-archive',
- OPTION_RETENTION_ARCHIVE_TYPE => 'retention-archive-type',
- OPTION_RETENTION_DIFF => 'retention-' . BACKUP_TYPE_DIFF,
- OPTION_RETENTION_FULL => 'retention-' . BACKUP_TYPE_FULL,
-
- # RESTORE Section
- OPTION_TABLESPACE => 'tablespace',
- OPTION_RESTORE_TABLESPACE_MAP => 'tablespace-map',
- OPTION_RESTORE_RECOVERY_SETTING => 'recovery-setting',
-
- # STANZA Section
- OPTION_DB_HOST => 'db-host',
- OPTION_DB_PATH => 'db-path',
- OPTION_DB_PORT => 'db-port',
- OPTION_DB_SOCKET_PATH => 'db-socket-path',
- OPTION_DB_USER => 'db-user',
-
- # Command-line-only help/version options
- OPTION_HELP => 'help',
- OPTION_VERSION => 'version',
-
- # Command-line-only test options
- OPTION_TEST => 'test',
- OPTION_TEST_DELAY => 'test-delay',
- OPTION_TEST_NO_FORK => 'no-fork'
-};
-
-push @EXPORT, qw(OPTION_CONFIG OPTION_DELTA OPTION_FORCE OPTION_NO_START_STOP OPTION_SET OPTION_STANZA OPTION_TARGET
- OPTION_TARGET_EXCLUSIVE OPTION_TARGET_RESUME OPTION_TARGET_TIMELINE OPTION_TYPE
-
- OPTION_DB_HOST OPTION_BACKUP_HOST OPTION_ARCHIVE_MAX_MB OPTION_BACKUP_ARCHIVE_CHECK OPTION_BACKUP_ARCHIVE_COPY
- OPTION_ARCHIVE_ASYNC
- OPTION_BUFFER_SIZE OPTION_COMPRESS OPTION_COMPRESS_LEVEL OPTION_COMPRESS_LEVEL_NETWORK OPTION_HARDLINK
- OPTION_MANIFEST_SAVE_THRESHOLD OPTION_RESUME OPTION_PATH_ARCHIVE OPTION_REPO_PATH OPTION_NEUTRAL_UMASK
- OPTION_REPO_REMOTE_PATH OPTION_DB_PATH OPTION_OUTPUT OPTION_LOG_LEVEL_CONSOLE OPTION_LOG_LEVEL_FILE
- OPTION_RESTORE_RECOVERY_SETTING OPTION_RETENTION_ARCHIVE OPTION_RETENTION_ARCHIVE_TYPE OPTION_RETENTION_FULL
- OPTION_RETENTION_DIFF OPTION_START_FAST OPTION_STOP_AUTO OPTION_THREAD_MAX OPTION_THREAD_TIMEOUT
- OPTION_DB_USER OPTION_BACKUP_USER OPTION_COMMAND_REMOTE OPTION_DB_TIMEOUT
- OPTION_TABLESPACE OPTION_RESTORE_TABLESPACE_MAP OPTION_DB_PORT OPTION_DB_SOCKET_PATH
-
- OPTION_TEST OPTION_TEST_DELAY OPTION_TEST_NO_FORK);
-
-####################################################################################################################################
-# Option Defaults
-####################################################################################################################################
-use constant
-{
- OPTION_DEFAULT_BUFFER_SIZE => 4194304,
- OPTION_DEFAULT_BUFFER_SIZE_MIN => 16384,
- OPTION_DEFAULT_BUFFER_SIZE_MAX => 8388608,
-
- OPTION_DEFAULT_COMPRESS => true,
- OPTION_DEFAULT_COMPRESS_LEVEL => 6,
- OPTION_DEFAULT_COMPRESS_LEVEL_MIN => 0,
- OPTION_DEFAULT_COMPRESS_LEVEL_MAX => 9,
- OPTION_DEFAULT_COMPRESS_LEVEL_NETWORK => 3,
- OPTION_DEFAULT_COMPRESS_LEVEL_NETWORK_MIN => 0,
- OPTION_DEFAULT_COMPRESS_LEVEL_NETWORK_MAX => 9,
-
- OPTION_DEFAULT_DB_TIMEOUT => 1800,
- OPTION_DEFAULT_CONFIG => '/etc/' . BACKREST_EXE . '.conf',
- OPTION_DEFAULT_LOG_LEVEL_CONSOLE => lc(WARN),
- OPTION_DEFAULT_LOG_LEVEL_FILE => lc(INFO),
- OPTION_DEFAULT_THREAD_MAX => 1,
-
- OPTION_DEFAULT_ARCHIVE_ASYNC => false,
-
- OPTION_DEFAULT_DB_PORT => 5432,
- OPTION_DEFAULT_DB_USER => 'postgres',
-
- OPTION_DEFAULT_COMMAND_REMOTE => abs_path($0),
-
- OPTION_DEFAULT_BACKUP_ARCHIVE_CHECK => true,
- OPTION_DEFAULT_BACKUP_ARCHIVE_COPY => false,
- OPTION_DEFAULT_BACKUP_FORCE => false,
- OPTION_DEFAULT_BACKUP_HARDLINK => false,
- OPTION_DEFAULT_BACKUP_NO_START_STOP => false,
- OPTION_DEFAULT_BACKUP_MANIFEST_SAVE_THRESHOLD => 1073741824,
- OPTION_DEFAULT_BACKUP_RESUME => true,
- OPTION_DEFAULT_BACKUP_STOP_AUTO => false,
- OPTION_DEFAULT_BACKUP_START_FAST => false,
- OPTION_DEFAULT_BACKUP_TYPE => BACKUP_TYPE_INCR,
-
- OPTION_DEFAULT_INFO_OUTPUT => INFO_OUTPUT_TEXT,
-
- OPTION_DEFAULT_NEUTRAL_UMASK => true,
- OPTION_DEFAULT_REPO_PATH => '/var/lib/backup',
-
- OPTION_DEFAULT_RESTORE_DELTA => false,
- OPTION_DEFAULT_RESTORE_FORCE => false,
- OPTION_DEFAULT_RESTORE_SET => 'latest',
- OPTION_DEFAULT_RESTORE_TABLESPACE => true,
- OPTION_DEFAULT_RESTORE_TYPE => RECOVERY_TYPE_DEFAULT,
- OPTION_DEFAULT_RESTORE_TARGET_EXCLUSIVE => false,
- OPTION_DEFAULT_RESTORE_TARGET_RESUME => false,
-
- OPTION_DEFAULT_RETENTION_ARCHIVE_TYPE => BACKUP_TYPE_FULL,
- OPTION_DEFAULT_RETENTION_MIN => 1,
- OPTION_DEFAULT_RETENTION_MAX => 999999999,
-
- OPTION_DEFAULT_TEST => false,
- OPTION_DEFAULT_TEST_DELAY => 5,
- OPTION_DEFAULT_TEST_NO_FORK => false
-};
-
-push @EXPORT, qw(OPTION_DEFAULT_BUFFER_SIZE OPTION_DEFAULT_COMPRESS OPTION_DEFAULT_CONFIG OPTION_LEVEL_CONSOLE OPTION_LEVEL_FILE
- OPTION_DEFAULT_THREAD_MAX
-
- OPTION_DEFAULT_COMPRESS OPTION_DEFAULT_COMPRESS_LEVEL OPTION_DEFAULT_COMPRESS_LEVEL_NETWORK
- OPTION_DEFAULT_COMMAND_REMOTE
-
- OPTION_DEFAULT_BACKUP_FORCE OPTION_DEFAULT_BACKUP_NO_START_STOP OPTION_DEFAULT_BACKUP_TYPE
-
- OPTION_DEFAULT_RESTORE_DELTA OPTION_DEFAULT_RESTORE_FORCE OPTION_DEFAULT_RESTORE_SET OPTION_DEFAULT_RESTORE_TYPE
- OPTION_DEFAULT_RESTORE_TARGET_EXCLUSIVE OPTION_DEFAULT_RESTORE_TARGET_RESUME
-
- OPTION_DEFAULT_TEST OPTION_DEFAULT_TEST_DELAY OPTION_DEFAULT_TEST_NO_FORK OPTION_DEFAULT_DB_PORT
- OPTION_DEFAULT_DB_USER);
+use constant RECOVERY_TYPE_NAME => 'name';
+ push @EXPORT, qw(RECOVERY_TYPE_NAME);
+use constant RECOVERY_TYPE_TIME => 'time';
+ push @EXPORT, qw(RECOVERY_TYPE_TIME);
+use constant RECOVERY_TYPE_XID => 'xid';
+ push @EXPORT, qw(RECOVERY_TYPE_XID);
+use constant RECOVERY_TYPE_PRESERVE => 'preserve';
+ push @EXPORT, qw(RECOVERY_TYPE_PRESERVE);
+use constant RECOVERY_TYPE_NONE => 'none';
+ push @EXPORT, qw(RECOVERY_TYPE_NONE);
+use constant RECOVERY_TYPE_DEFAULT => 'default';
+ push @EXPORT, qw(RECOVERY_TYPE_DEFAULT);
####################################################################################################################################
# Option Rules
####################################################################################################################################
-use constant
-{
- OPTION_RULE_ALLOW_LIST => 'allow-list',
- OPTION_RULE_ALLOW_RANGE => 'allow-range',
- OPTION_RULE_DEFAULT => 'default',
- OPTION_RULE_DEPEND => 'depend',
- OPTION_RULE_DEPEND_OPTION => 'depend-option',
- OPTION_RULE_DEPEND_LIST => 'depend-list',
- OPTION_RULE_DEPEND_VALUE => 'depend-value',
- OPTION_RULE_HINT => 'hint',
- OPTION_RULE_NEGATE => 'negate',
- OPTION_RULE_COMMAND => 'command',
- OPTION_RULE_REQUIRED => 'required',
- OPTION_RULE_SECTION => 'section',
- OPTION_RULE_SECTION_INHERIT => 'section-inherit',
- OPTION_RULE_TYPE => 'type'
-};
-
-push @EXPORT, qw(OPTION_RULE_ALLOW_LIST OPTION_RULE_ALLOW_RANGE OPTION_RULE_DEFAULT OPTION_RULE_DEPEND OPTION_RULE_DEPEND_OPTION
- OPTION_RULE_DEPEND_LIST OPTION_RULE_DEPEND_VALUE OPTION_RULE_NEGATE OPTION_RULE_COMMAND OPTION_RULE_REQUIRED
- OPTION_RULE_SECTION OPTION_RULE_SECTION_INHERIT OPTION_RULE_TYPE);
+use constant OPTION_RULE_ALLOW_LIST => 'allow-list';
+ push @EXPORT, qw(OPTION_RULE_ALLOW_LIST);
+use constant OPTION_RULE_ALLOW_RANGE => 'allow-range';
+ push @EXPORT, qw(OPTION_RULE_ALLOW_RANGE);
+use constant OPTION_RULE_DEFAULT => 'default';
+ push @EXPORT, qw(OPTION_RULE_DEFAULT);
+use constant OPTION_RULE_DEPEND => 'depend';
+ push @EXPORT, qw(OPTION_RULE_DEPEND);
+use constant OPTION_RULE_DEPEND_OPTION => 'depend-option';
+ push @EXPORT, qw(OPTION_RULE_DEPEND_OPTION);
+use constant OPTION_RULE_DEPEND_LIST => 'depend-list';
+ push @EXPORT, qw(OPTION_RULE_DEPEND_LIST);
+use constant OPTION_RULE_DEPEND_VALUE => 'depend-value';
+ push @EXPORT, qw(OPTION_RULE_DEPEND_VALUE);
+use constant OPTION_RULE_HINT => 'hint';
+ push @EXPORT, qw(OPTION_RULE_HINT);
+use constant OPTION_RULE_NEGATE => 'negate';
+ push @EXPORT, qw(OPTION_RULE_NEGATE);
+use constant OPTION_RULE_COMMAND => 'command';
+ push @EXPORT, qw(OPTION_RULE_COMMAND);
+use constant OPTION_RULE_REQUIRED => 'required';
+ push @EXPORT, qw(OPTION_RULE_REQUIRED);
+use constant OPTION_RULE_SECTION => 'section';
+ push @EXPORT, qw(OPTION_RULE_SECTION);
+use constant OPTION_RULE_SECTION_INHERIT => 'section-inherit';
+ push @EXPORT, qw(OPTION_RULE_SECTION_INHERIT);
+use constant OPTION_RULE_TYPE => 'type';
+ push @EXPORT, qw(OPTION_RULE_TYPE);
####################################################################################################################################
# Option Types
####################################################################################################################################
-use constant
-{
- OPTION_TYPE_BOOLEAN => 'boolean',
- OPTION_TYPE_FLOAT => 'float',
- OPTION_TYPE_HASH => 'hash',
- OPTION_TYPE_INTEGER => 'integer',
- OPTION_TYPE_STRING => 'string'
-};
+use constant OPTION_TYPE_BOOLEAN => 'boolean';
+ push @EXPORT, qw(OPTION_TYPE_BOOLEAN);
+use constant OPTION_TYPE_FLOAT => 'float';
+ push @EXPORT, qw(OPTION_TYPE_FLOAT);
+use constant OPTION_TYPE_HASH => 'hash';
+ push @EXPORT, qw(OPTION_TYPE_HASH);
+use constant OPTION_TYPE_INTEGER => 'integer';
+ push @EXPORT, qw(OPTION_TYPE_INTEGER);
+use constant OPTION_TYPE_STRING => 'string';
+ push @EXPORT, qw(OPTION_TYPE_STRING);
-push @EXPORT, qw(OPTION_TYPE_BOOLEAN OPTION_TYPE_FLOAT OPTION_TYPE_INTEGER OPTION_TYPE_STRING);
+####################################################################################################################################
+# Configuration section constants
+####################################################################################################################################
+use constant CONFIG_GLOBAL => 'global';
+ push @EXPORT, qw(CONFIG_GLOBAL);
+
+use constant CONFIG_SECTION_ARCHIVE => 'archive';
+ push @EXPORT, qw(CONFIG_SECTION_ARCHIVE);
+use constant CONFIG_SECTION_BACKUP => 'backup';
+ push @EXPORT, qw(CONFIG_SECTION_BACKUP);
+use constant CONFIG_SECTION_COMMAND => 'command';
+ push @EXPORT, qw(CONFIG_SECTION_COMMAND);
+use constant CONFIG_SECTION_GENERAL => 'general';
+ push @EXPORT, qw(CONFIG_SECTION_GENERAL);
+use constant CONFIG_SECTION_LOG => 'log';
+ push @EXPORT, qw(CONFIG_SECTION_LOG);
+use constant CONFIG_SECTION_RESTORE_RECOVERY_SETTING => 'restore:recovery-setting';
+ push @EXPORT, qw(CONFIG_SECTION_RESTORE_RECOVERY_SETTING);
+use constant CONFIG_SECTION_RESTORE_TABLESPACE_MAP => 'restore:tablespace-map';
+ push @EXPORT, qw(CONFIG_SECTION_RESTORE_TABLESPACE_MAP);
+use constant CONFIG_SECTION_EXPIRE => 'expire';
+ push @EXPORT, qw(CONFIG_SECTION_EXPIRE);
+use constant CONFIG_SECTION_STANZA => 'stanza';
+ push @EXPORT, qw(CONFIG_SECTION_STANZA);
+
+####################################################################################################################################
+# Option constants
+####################################################################################################################################
+# Command-line only
+#-----------------------------------------------------------------------------------------------------------------------------------
+use constant OPTION_CONFIG => 'config';
+ push @EXPORT, qw(OPTION_CONFIG);
+use constant OPTION_DELTA => 'delta';
+ push @EXPORT, qw(OPTION_DELTA);
+use constant OPTION_FORCE => 'force';
+ push @EXPORT, qw(OPTION_FORCE);
+use constant OPTION_NO_START_STOP => 'no-start-stop';
+ push @EXPORT, qw(OPTION_NO_START_STOP);
+use constant OPTION_SET => 'set';
+ push @EXPORT, qw(OPTION_SET);
+use constant OPTION_STANZA => 'stanza';
+ push @EXPORT, qw(OPTION_STANZA);
+use constant OPTION_TARGET => 'target';
+ push @EXPORT, qw(OPTION_TARGET);
+use constant OPTION_TARGET_EXCLUSIVE => 'target-exclusive';
+ push @EXPORT, qw(OPTION_TARGET_EXCLUSIVE);
+use constant OPTION_TARGET_RESUME => 'target-resume';
+ push @EXPORT, qw(OPTION_TARGET_RESUME);
+use constant OPTION_TARGET_TIMELINE => 'target-timeline';
+ push @EXPORT, qw(OPTION_TARGET_TIMELINE);
+use constant OPTION_TYPE => 'type';
+ push @EXPORT, qw(OPTION_TYPE);
+use constant OPTION_OUTPUT => 'output';
+ push @EXPORT, qw(OPTION_OUTPUT);
+
+# Command-line only help/version
+#-----------------------------------------------------------------------------------------------------------------------------------
+use constant OPTION_HELP => 'help';
+ push @EXPORT, qw(OPTION_HELP);
+use constant OPTION_VERSION => 'version';
+ push @EXPORT, qw(OPTION_VERSION);
+
+# Command-line only test
+#-----------------------------------------------------------------------------------------------------------------------------------
+use constant OPTION_TEST => 'test';
+ push @EXPORT, qw(OPTION_TEST);
+use constant OPTION_TEST_DELAY => 'test-delay';
+ push @EXPORT, qw(OPTION_TEST_DELAY);
+use constant OPTION_TEST_NO_FORK => 'no-fork';
+ push @EXPORT, qw(OPTION_TEST_NO_FORK);
+
+# GENERAL Section
+#-----------------------------------------------------------------------------------------------------------------------------------
+use constant OPTION_BUFFER_SIZE => 'buffer-size';
+ push @EXPORT, qw(OPTION_BUFFER_SIZE);
+use constant OPTION_DB_TIMEOUT => 'db-timeout';
+ push @EXPORT, qw(OPTION_DB_TIMEOUT);
+use constant OPTION_COMPRESS => 'compress';
+ push @EXPORT, qw(OPTION_COMPRESS);
+use constant OPTION_COMPRESS_LEVEL => 'compress-level';
+ push @EXPORT, qw(OPTION_COMPRESS_LEVEL);
+use constant OPTION_COMPRESS_LEVEL_NETWORK => 'compress-level-network';
+ push @EXPORT, qw(OPTION_COMPRESS_LEVEL_NETWORK);
+use constant OPTION_NEUTRAL_UMASK => 'neutral-umask';
+ push @EXPORT, qw(OPTION_NEUTRAL_UMASK);
+use constant OPTION_REPO_PATH => 'repo-path';
+ push @EXPORT, qw(OPTION_REPO_PATH);
+use constant OPTION_REPO_REMOTE_PATH => 'repo-remote-path';
+ push @EXPORT, qw(OPTION_REPO_REMOTE_PATH);
+use constant OPTION_THREAD_MAX => 'thread-max';
+ push @EXPORT, qw(OPTION_THREAD_MAX);
+use constant OPTION_THREAD_TIMEOUT => 'thread-timeout';
+ push @EXPORT, qw(OPTION_THREAD_TIMEOUT);
+
+# COMMAND Section
+#-----------------------------------------------------------------------------------------------------------------------------------
+use constant OPTION_COMMAND_REMOTE => 'cmd-remote';
+ push @EXPORT, qw(OPTION_COMMAND_REMOTE);
+
+# LOG Section
+#-----------------------------------------------------------------------------------------------------------------------------------
+use constant OPTION_LOG_LEVEL_CONSOLE => 'log-level-console';
+ push @EXPORT, qw(OPTION_LOG_LEVEL_CONSOLE);
+use constant OPTION_LOG_LEVEL_FILE => 'log-level-file';
+ push @EXPORT, qw(OPTION_LOG_LEVEL_FILE);
+
+# ARCHIVE Section
+#-----------------------------------------------------------------------------------------------------------------------------------
+use constant OPTION_ARCHIVE_ASYNC => 'archive-async';
+ push @EXPORT, qw(OPTION_ARCHIVE_ASYNC);
+use constant OPTION_ARCHIVE_MAX_MB => 'archive-max-mb';
+ push @EXPORT, qw(OPTION_ARCHIVE_MAX_MB);
+
+# BACKUP Section
+#-----------------------------------------------------------------------------------------------------------------------------------
+use constant OPTION_BACKUP_ARCHIVE_CHECK => 'archive-check';
+ push @EXPORT, qw(OPTION_BACKUP_ARCHIVE_CHECK);
+use constant OPTION_BACKUP_ARCHIVE_COPY => 'archive-copy';
+ push @EXPORT, qw(OPTION_BACKUP_ARCHIVE_COPY);
+use constant OPTION_BACKUP_HOST => 'backup-host';
+ push @EXPORT, qw(OPTION_BACKUP_HOST);
+use constant OPTION_BACKUP_USER => 'backup-user';
+ push @EXPORT, qw(OPTION_BACKUP_USER);
+use constant OPTION_HARDLINK => 'hardlink';
+ push @EXPORT, qw(OPTION_HARDLINK);
+use constant OPTION_MANIFEST_SAVE_THRESHOLD => 'manifest-save-threshold';
+ push @EXPORT, qw(OPTION_MANIFEST_SAVE_THRESHOLD);
+use constant OPTION_RESUME => 'resume';
+ push @EXPORT, qw(OPTION_RESUME);
+use constant OPTION_START_FAST => 'start-fast';
+ push @EXPORT, qw(OPTION_START_FAST);
+use constant OPTION_STOP_AUTO => 'stop-auto';
+ push @EXPORT, qw(OPTION_STOP_AUTO);
+
+# EXPIRE Section
+#-----------------------------------------------------------------------------------------------------------------------------------
+use constant OPTION_RETENTION_ARCHIVE => 'retention-archive';
+ push @EXPORT, qw(OPTION_RETENTION_ARCHIVE);
+use constant OPTION_RETENTION_ARCHIVE_TYPE => 'retention-archive-type';
+ push @EXPORT, qw(OPTION_RETENTION_ARCHIVE_TYPE);
+use constant OPTION_RETENTION_DIFF => 'retention-' . BACKUP_TYPE_DIFF;
+ push @EXPORT, qw(OPTION_RETENTION_DIFF);
+use constant OPTION_RETENTION_FULL => 'retention-' . BACKUP_TYPE_FULL;
+ push @EXPORT, qw(OPTION_RETENTION_FULL);
+
+# RESTORE Section
+#-----------------------------------------------------------------------------------------------------------------------------------
+use constant OPTION_TABLESPACE => 'tablespace';
+ push @EXPORT, qw(OPTION_TABLESPACE);
+use constant OPTION_RESTORE_TABLESPACE_MAP => 'tablespace-map';
+ push @EXPORT, qw(OPTION_RESTORE_TABLESPACE_MAP);
+use constant OPTION_RESTORE_RECOVERY_SETTING => 'recovery-setting';
+ push @EXPORT, qw(OPTION_RESTORE_RECOVERY_SETTING);
+
+# STANZA Section
+#-----------------------------------------------------------------------------------------------------------------------------------
+use constant OPTION_DB_HOST => 'db-host';
+ push @EXPORT, qw(OPTION_DB_HOST);
+use constant OPTION_DB_PATH => 'db-path';
+ push @EXPORT, qw(OPTION_DB_PATH);
+use constant OPTION_DB_PORT => 'db-port';
+ push @EXPORT, qw(OPTION_DB_PORT);
+use constant OPTION_DB_SOCKET_PATH => 'db-socket-path';
+ push @EXPORT, qw(OPTION_DB_SOCKET_PATH);
+use constant OPTION_DB_USER => 'db-user';
+ push @EXPORT, qw(OPTION_DB_USER);
+
+####################################################################################################################################
+# Option Defaults
+####################################################################################################################################
+# Command-line only
+#-----------------------------------------------------------------------------------------------------------------------------------
+use constant OPTION_DEFAULT_BACKUP_TYPE => BACKUP_TYPE_INCR;
+ push @EXPORT, qw(OPTION_DEFAULT_BACKUP_TYPE);
+use constant OPTION_DEFAULT_INFO_OUTPUT => INFO_OUTPUT_TEXT;
+ push @EXPORT, qw(OPTION_DEFAULT_INFO_OUTPUT);
+use constant OPTION_DEFAULT_RESTORE_DELTA => false;
+ push @EXPORT, qw(OPTION_DEFAULT_RESTORE_DELTA);
+use constant OPTION_DEFAULT_RESTORE_FORCE => false;
+ push @EXPORT, qw(OPTION_DEFAULT_RESTORE_FORCE);
+use constant OPTION_DEFAULT_RESTORE_SET => 'latest';
+ push @EXPORT, qw(OPTION_DEFAULT_RESTORE_SET);
+use constant OPTION_DEFAULT_RESTORE_TARGET_EXCLUSIVE => false;
+ push @EXPORT, qw(OPTION_DEFAULT_RESTORE_TARGET_EXCLUSIVE);
+use constant OPTION_DEFAULT_RESTORE_TARGET_RESUME => false;
+ push @EXPORT, qw(OPTION_DEFAULT_RESTORE_TARGET_RESUME);
+use constant OPTION_DEFAULT_RESTORE_TYPE => RECOVERY_TYPE_DEFAULT;
+ push @EXPORT, qw(OPTION_DEFAULT_RESTORE_TYPE);
+
+# Command-line only test
+#-----------------------------------------------------------------------------------------------------------------------------------
+use constant OPTION_DEFAULT_TEST => false;
+ push @EXPORT, qw(OPTION_DEFAULT_TEST);
+use constant OPTION_DEFAULT_TEST_DELAY => 5;
+ push @EXPORT, qw(OPTION_DEFAULT_TEST_DELAY);
+use constant OPTION_DEFAULT_TEST_NO_FORK => false;
+ push @EXPORT, qw(OPTION_DEFAULT_TEST_NO_FORK);
+
+# GENERAL Section
+#-----------------------------------------------------------------------------------------------------------------------------------
+use constant OPTION_DEFAULT_BUFFER_SIZE => 4194304;
+ push @EXPORT, qw(OPTION_DEFAULT_BUFFER_SIZE);
+use constant OPTION_DEFAULT_BUFFER_SIZE_MIN => 16384;
+ push @EXPORT, qw(OPTION_DEFAULT_BUFFER_SIZE_MIN);
+use constant OPTION_DEFAULT_BUFFER_SIZE_MAX => 8388608;
+ push @EXPORT, qw(OPTION_DEFAULT_BUFFER_SIZE_MAX);
+
+use constant OPTION_DEFAULT_COMPRESS => true;
+ push @EXPORT, qw(OPTION_DEFAULT_COMPRESS);
+
+use constant OPTION_DEFAULT_COMPRESS_LEVEL => 6;
+ push @EXPORT, qw(OPTION_DEFAULT_COMPRESS_LEVEL);
+use constant OPTION_DEFAULT_COMPRESS_LEVEL_MIN => 0;
+ push @EXPORT, qw(OPTION_DEFAULT_COMPRESS_LEVEL_MIN);
+use constant OPTION_DEFAULT_COMPRESS_LEVEL_MAX => 9;
+ push @EXPORT, qw(OPTION_DEFAULT_COMPRESS_LEVEL_MAX);
+
+use constant OPTION_DEFAULT_COMPRESS_LEVEL_NETWORK => 3;
+ push @EXPORT, qw(OPTION_DEFAULT_COMPRESS_LEVEL_NETWORK);
+use constant OPTION_DEFAULT_COMPRESS_LEVEL_NETWORK_MIN => 0;
+ push @EXPORT, qw(OPTION_DEFAULT_COMPRESS_LEVEL_NETWORK_MIN);
+use constant OPTION_DEFAULT_COMPRESS_LEVEL_NETWORK_MAX => 9;
+ push @EXPORT, qw(OPTION_DEFAULT_COMPRESS_LEVEL_NETWORK_MAX);
+
+use constant OPTION_DEFAULT_DB_TIMEOUT => 1800;
+ push @EXPORT, qw(OPTION_DEFAULT_DB_TIMEOUT);
+use constant OPTION_DEFAULT_CONFIG => '/etc/' . BACKREST_EXE . '.conf';
+ push @EXPORT, qw(OPTION_DEFAULT_CONFIG);
+use constant OPTION_DEFAULT_NEUTRAL_UMASK => true;
+ push @EXPORT, qw(OPTION_DEFAULT_NEUTRAL_UMASK);
+use constant OPTION_DEFAULT_REPO_PATH => '/var/lib/backup';
+ push @EXPORT, qw(OPTION_DEFAULT_REPO_PATH);
+use constant OPTION_DEFAULT_THREAD_MAX => 1;
+ push @EXPORT, qw(OPTION_DEFAULT_THREAD_MAX);
+
+# COMMAND Section
+#-----------------------------------------------------------------------------------------------------------------------------------
+use constant OPTION_DEFAULT_COMMAND_REMOTE => abs_path($0);
+ push @EXPORT, qw(OPTION_DEFAULT_COMMAND_REMOTE);
+
+# LOG Section
+#-----------------------------------------------------------------------------------------------------------------------------------
+use constant OPTION_LOG_LEVEL_CONSOLE => 'log-level-console';
+ push @EXPORT, qw(OPTION_LOG_LEVEL_CONSOLE);
+use constant OPTION_LOG_LEVEL_FILE => 'log-level-file';
+ push @EXPORT, qw(OPTION_LOG_LEVEL_FILE);
+
+use constant OPTION_DEFAULT_LOG_LEVEL_CONSOLE => lc(WARN);
+ push @EXPORT, qw(OPTION_DEFAULT_LOG_LEVEL_CONSOLE);
+use constant OPTION_DEFAULT_LOG_LEVEL_FILE => lc(INFO);
+ push @EXPORT, qw(OPTION_DEFAULT_LOG_LEVEL_FILE);
+
+# ARCHIVE SECTION
+#-----------------------------------------------------------------------------------------------------------------------------------
+use constant OPTION_DEFAULT_ARCHIVE_ASYNC => false;
+ push @EXPORT, qw(OPTION_DEFAULT_ARCHIVE_ASYNC);
+
+# BACKUP Section
+#-----------------------------------------------------------------------------------------------------------------------------------
+use constant OPTION_DEFAULT_BACKUP_ARCHIVE_CHECK => true;
+ push @EXPORT, qw(OPTION_DEFAULT_BACKUP_ARCHIVE_CHECK);
+use constant OPTION_DEFAULT_BACKUP_ARCHIVE_COPY => false;
+ push @EXPORT, qw(OPTION_DEFAULT_BACKUP_ARCHIVE_COPY);
+use constant OPTION_DEFAULT_BACKUP_FORCE => false;
+ push @EXPORT, qw(OPTION_DEFAULT_BACKUP_FORCE);
+use constant OPTION_DEFAULT_BACKUP_HARDLINK => false;
+ push @EXPORT, qw(OPTION_DEFAULT_BACKUP_HARDLINK);
+use constant OPTION_DEFAULT_BACKUP_NO_START_STOP => false;
+ push @EXPORT, qw(OPTION_DEFAULT_BACKUP_NO_START_STOP);
+use constant OPTION_DEFAULT_BACKUP_MANIFEST_SAVE_THRESHOLD => 1073741824;
+ push @EXPORT, qw(OPTION_DEFAULT_BACKUP_MANIFEST_SAVE_THRESHOLD);
+use constant OPTION_DEFAULT_BACKUP_RESUME => true;
+ push @EXPORT, qw(OPTION_DEFAULT_BACKUP_RESUME);
+use constant OPTION_DEFAULT_BACKUP_STOP_AUTO => false;
+ push @EXPORT, qw(OPTION_DEFAULT_BACKUP_STOP_AUTO);
+use constant OPTION_DEFAULT_BACKUP_START_FAST => false;
+ push @EXPORT, qw(OPTION_DEFAULT_BACKUP_START_FAST);
+
+# RESTORE SECTION
+#-----------------------------------------------------------------------------------------------------------------------------------
+use constant OPTION_DEFAULT_RESTORE_TABLESPACE => true;
+ push @EXPORT, qw(OPTION_DEFAULT_RESTORE_TABLESPACE);
+
+# EXPIRE Section
+#-----------------------------------------------------------------------------------------------------------------------------------
+use constant OPTION_DEFAULT_RETENTION_ARCHIVE_TYPE => BACKUP_TYPE_FULL;
+ push @EXPORT, qw(OPTION_DEFAULT_RETENTION_ARCHIVE_TYPE);
+use constant OPTION_DEFAULT_RETENTION_MIN => 1;
+ push @EXPORT, qw(OPTION_DEFAULT_RETENTION_MIN);
+use constant OPTION_DEFAULT_RETENTION_MAX => 999999999;
+ push @EXPORT, qw(OPTION_DEFAULT_RETENTION_MAX);
+
+# STANZA Section
+#-----------------------------------------------------------------------------------------------------------------------------------
+use constant OPTION_DEFAULT_DB_PORT => 5432;
+ push @EXPORT, qw(OPTION_DEFAULT_DB_PORT);
+use constant OPTION_DEFAULT_DB_USER => 'postgres';
+ push @EXPORT, qw(OPTION_DEFAULT_DB_USER);
####################################################################################################################################
# Option Rule Hash
####################################################################################################################################
my %oOptionRule =
(
- # Command-line-only option rule
+ # Command-line only
#-------------------------------------------------------------------------------------------------------------------------------
&OPTION_CONFIG =>
{
@@ -585,174 +680,37 @@ my %oOptionRule =
}
},
- # Command-line/conf option rules
+ # Command-line only test
#-------------------------------------------------------------------------------------------------------------------------------
- &OPTION_COMMAND_REMOTE =>
- {
- &OPTION_RULE_TYPE => OPTION_TYPE_STRING,
- &OPTION_RULE_DEFAULT => OPTION_DEFAULT_COMMAND_REMOTE,
- &OPTION_RULE_SECTION => CONFIG_SECTION_COMMAND,
- &OPTION_RULE_COMMAND =>
- {
- &CMD_ARCHIVE_GET => true,
- &CMD_ARCHIVE_PUSH => true,
- &CMD_BACKUP => true,
- &CMD_INFO => true,
- &CMD_RESTORE => true
- }
- },
-
- &OPTION_ARCHIVE_ASYNC =>
+ &OPTION_TEST =>
{
&OPTION_RULE_TYPE => OPTION_TYPE_BOOLEAN,
- &OPTION_RULE_DEFAULT => OPTION_DEFAULT_ARCHIVE_ASYNC,
- &OPTION_RULE_SECTION => CONFIG_SECTION_ARCHIVE,
- &OPTION_RULE_COMMAND =>
- {
- &CMD_ARCHIVE_PUSH => true
- }
+ &OPTION_RULE_DEFAULT => OPTION_DEFAULT_TEST
},
- &OPTION_DB_HOST =>
+ &OPTION_TEST_DELAY =>
{
- &OPTION_RULE_TYPE => OPTION_TYPE_STRING,
- &OPTION_RULE_REQUIRED => false,
- &OPTION_RULE_SECTION => CONFIG_SECTION_STANZA,
- &OPTION_RULE_COMMAND =>
- {
- &CMD_BACKUP => true
- }
- },
-
- &OPTION_DB_PORT =>
- {
- &OPTION_RULE_TYPE => OPTION_TYPE_INTEGER,
- &OPTION_RULE_DEFAULT => OPTION_DEFAULT_DB_PORT,
- &OPTION_RULE_SECTION => CONFIG_SECTION_STANZA,
- &OPTION_RULE_COMMAND =>
- {
- &CMD_BACKUP => true,
- &CMD_REMOTE => true
- }
- },
-
- &OPTION_DB_SOCKET_PATH =>
- {
- &OPTION_RULE_TYPE => OPTION_TYPE_STRING,
- &OPTION_RULE_REQUIRED => false,
- &OPTION_RULE_SECTION => CONFIG_SECTION_STANZA,
- &OPTION_RULE_COMMAND =>
- {
- &CMD_BACKUP => true,
- &CMD_REMOTE => true
- }
- },
-
- &OPTION_DB_USER =>
- {
- &OPTION_RULE_TYPE => OPTION_TYPE_STRING,
- &OPTION_RULE_DEFAULT => OPTION_DEFAULT_DB_USER,
- &OPTION_RULE_SECTION => CONFIG_SECTION_STANZA,
- &OPTION_RULE_COMMAND =>
- {
- &CMD_BACKUP => true
- },
- &OPTION_RULE_REQUIRED => false,
+ &OPTION_RULE_TYPE => OPTION_TYPE_FLOAT,
+ &OPTION_RULE_DEFAULT => OPTION_DEFAULT_TEST_DELAY,
&OPTION_RULE_DEPEND =>
{
- &OPTION_RULE_DEPEND_OPTION => OPTION_DB_HOST
+ &OPTION_RULE_DEPEND_OPTION => OPTION_TEST,
+ &OPTION_RULE_DEPEND_VALUE => true
}
},
- &OPTION_BACKUP_HOST =>
- {
- &OPTION_RULE_TYPE => OPTION_TYPE_STRING,
- &OPTION_RULE_REQUIRED => false,
- &OPTION_RULE_SECTION => CONFIG_SECTION_BACKUP,
- &OPTION_RULE_COMMAND =>
- {
- &CMD_ARCHIVE_GET => true,
- &CMD_ARCHIVE_PUSH => true,
- &CMD_INFO => true,
- &CMD_RESTORE => true
- },
- },
-
- &OPTION_BACKUP_USER =>
- {
- &OPTION_RULE_TYPE => OPTION_TYPE_STRING,
- &OPTION_RULE_SECTION => CONFIG_SECTION_BACKUP,
- &OPTION_RULE_COMMAND =>
- {
- &CMD_ARCHIVE_GET => true,
- &CMD_ARCHIVE_PUSH => true,
- &CMD_INFO => true,
- &CMD_RESTORE => true
- },
- &OPTION_RULE_REQUIRED => false,
- &OPTION_RULE_DEPEND =>
- {
- &OPTION_RULE_DEPEND_OPTION => OPTION_BACKUP_HOST
- }
- },
-
- &OPTION_NEUTRAL_UMASK =>
+ &OPTION_TEST_NO_FORK =>
{
&OPTION_RULE_TYPE => OPTION_TYPE_BOOLEAN,
- &OPTION_RULE_DEFAULT => OPTION_DEFAULT_NEUTRAL_UMASK,
- &OPTION_RULE_SECTION => CONFIG_SECTION_GENERAL
- },
-
- &OPTION_REPO_PATH =>
- {
- &OPTION_RULE_TYPE => OPTION_TYPE_STRING,
- &OPTION_RULE_DEFAULT => OPTION_DEFAULT_REPO_PATH,
- &OPTION_RULE_SECTION => CONFIG_SECTION_GENERAL,
- &OPTION_RULE_COMMAND =>
+ &OPTION_RULE_DEFAULT => OPTION_DEFAULT_TEST_NO_FORK,
+ &OPTION_RULE_DEPEND =>
{
- &CMD_ARCHIVE_GET => true,
- &CMD_ARCHIVE_PUSH => true,
- &CMD_BACKUP => true,
- &CMD_INFO => true,
- &CMD_RESTORE => true,
- &CMD_EXPIRE => true
- },
- },
-
- &OPTION_REPO_REMOTE_PATH =>
- {
- &OPTION_RULE_TYPE => OPTION_TYPE_STRING,
- &OPTION_RULE_REQUIRED => false,
- &OPTION_RULE_SECTION => CONFIG_SECTION_GENERAL,
- &OPTION_RULE_COMMAND =>
- {
- &CMD_ARCHIVE_GET => true,
- &CMD_ARCHIVE_PUSH => true,
- &CMD_INFO => true,
- &CMD_REMOTE => true,
- &CMD_RESTORE => true
- },
- },
-
- &OPTION_DB_PATH =>
- {
- &OPTION_RULE_TYPE => OPTION_TYPE_STRING,
- &OPTION_RULE_SECTION => CONFIG_SECTION_STANZA,
- &OPTION_RULE_HINT => "Does this stanza exist?",
- &OPTION_RULE_COMMAND =>
- {
- &CMD_ARCHIVE_GET =>
- {
- &OPTION_RULE_REQUIRED => false
- },
- &CMD_ARCHIVE_PUSH =>
- {
- &OPTION_RULE_REQUIRED => false
- },
- &CMD_BACKUP => true
- },
+ &OPTION_RULE_DEPEND_OPTION => OPTION_TEST
+ }
},
+ # GENERAL Section
+ #-------------------------------------------------------------------------------------------------------------------------------
&OPTION_BUFFER_SIZE =>
{
&OPTION_RULE_TYPE => OPTION_TYPE_INTEGER,
@@ -762,50 +720,16 @@ my %oOptionRule =
&OPTION_RULE_ALLOW_RANGE => [OPTION_DEFAULT_BUFFER_SIZE_MIN, OPTION_DEFAULT_BUFFER_SIZE_MAX]
},
- &OPTION_ARCHIVE_MAX_MB =>
+ &OPTION_DB_TIMEOUT =>
{
&OPTION_RULE_TYPE => OPTION_TYPE_INTEGER,
- &OPTION_RULE_REQUIRED => false,
- &OPTION_RULE_SECTION => CONFIG_SECTION_ARCHIVE,
- &OPTION_RULE_COMMAND =>
- {
- &CMD_ARCHIVE_PUSH => true
- }
- },
-
- &OPTION_BACKUP_ARCHIVE_CHECK =>
- {
- &OPTION_RULE_TYPE => OPTION_TYPE_BOOLEAN,
- &OPTION_RULE_DEFAULT => OPTION_DEFAULT_BACKUP_ARCHIVE_CHECK,
+ &OPTION_RULE_DEFAULT => OPTION_DEFAULT_DB_TIMEOUT,
&OPTION_RULE_SECTION => true,
+ &OPTION_RULE_SECTION_INHERIT => CONFIG_SECTION_GENERAL,
&OPTION_RULE_COMMAND =>
{
- &CMD_BACKUP =>
- {
- &OPTION_RULE_DEPEND =>
- {
- &OPTION_RULE_DEPEND_OPTION => OPTION_NO_START_STOP,
- &OPTION_RULE_DEPEND_VALUE => false
- }
- }
- }
- },
-
- &OPTION_BACKUP_ARCHIVE_COPY =>
- {
- &OPTION_RULE_TYPE => OPTION_TYPE_BOOLEAN,
- &OPTION_RULE_DEFAULT => OPTION_DEFAULT_BACKUP_ARCHIVE_COPY,
- &OPTION_RULE_SECTION => true,
- &OPTION_RULE_COMMAND =>
- {
- &CMD_BACKUP =>
- {
- &OPTION_RULE_DEPEND =>
- {
- &OPTION_RULE_DEPEND_OPTION => OPTION_BACKUP_ARCHIVE_CHECK,
- &OPTION_RULE_DEPEND_VALUE => true
- }
- }
+ &CMD_BACKUP => true,
+ &CMD_REMOTE => true
}
},
@@ -860,17 +784,89 @@ my %oOptionRule =
}
},
- &OPTION_HARDLINK =>
+ &OPTION_NEUTRAL_UMASK =>
{
&OPTION_RULE_TYPE => OPTION_TYPE_BOOLEAN,
- &OPTION_RULE_DEFAULT => OPTION_DEFAULT_BACKUP_HARDLINK,
- &OPTION_RULE_SECTION => true,
+ &OPTION_RULE_DEFAULT => OPTION_DEFAULT_NEUTRAL_UMASK,
+ &OPTION_RULE_SECTION => CONFIG_SECTION_GENERAL
+ },
+
+ &OPTION_REPO_PATH =>
+ {
+ &OPTION_RULE_TYPE => OPTION_TYPE_STRING,
+ &OPTION_RULE_DEFAULT => OPTION_DEFAULT_REPO_PATH,
+ &OPTION_RULE_SECTION => CONFIG_SECTION_GENERAL,
&OPTION_RULE_COMMAND =>
{
- &CMD_BACKUP => true
+ &CMD_ARCHIVE_GET => true,
+ &CMD_ARCHIVE_PUSH => true,
+ &CMD_BACKUP => true,
+ &CMD_INFO => true,
+ &CMD_RESTORE => true,
+ &CMD_EXPIRE => true
+ },
+ },
+
+ &OPTION_REPO_REMOTE_PATH =>
+ {
+ &OPTION_RULE_TYPE => OPTION_TYPE_STRING,
+ &OPTION_RULE_REQUIRED => false,
+ &OPTION_RULE_SECTION => CONFIG_SECTION_GENERAL,
+ &OPTION_RULE_COMMAND =>
+ {
+ &CMD_ARCHIVE_GET => true,
+ &CMD_ARCHIVE_PUSH => true,
+ &CMD_INFO => true,
+ &CMD_REMOTE => true,
+ &CMD_RESTORE => true
+ },
+ },
+
+ &OPTION_THREAD_MAX =>
+ {
+ &OPTION_RULE_TYPE => OPTION_TYPE_INTEGER,
+ &OPTION_RULE_DEFAULT => OPTION_DEFAULT_THREAD_MAX,
+ &OPTION_RULE_SECTION => true,
+ &OPTION_RULE_SECTION_INHERIT => CONFIG_SECTION_GENERAL,
+ &OPTION_RULE_COMMAND =>
+ {
+ &CMD_BACKUP => true,
+ &CMD_RESTORE => true
}
},
+ &OPTION_THREAD_TIMEOUT =>
+ {
+ &OPTION_RULE_TYPE => OPTION_TYPE_INTEGER,
+ &OPTION_RULE_REQUIRED => false,
+ &OPTION_RULE_SECTION => true,
+ &OPTION_RULE_SECTION_INHERIT => CONFIG_SECTION_BACKUP,
+ &OPTION_RULE_COMMAND =>
+ {
+ &CMD_BACKUP => true,
+ &CMD_RESTORE => true
+ }
+ },
+
+ # COMMAND Section
+ #-------------------------------------------------------------------------------------------------------------------------------
+ &OPTION_COMMAND_REMOTE =>
+ {
+ &OPTION_RULE_TYPE => OPTION_TYPE_STRING,
+ &OPTION_RULE_DEFAULT => OPTION_DEFAULT_COMMAND_REMOTE,
+ &OPTION_RULE_SECTION => CONFIG_SECTION_COMMAND,
+ &OPTION_RULE_COMMAND =>
+ {
+ &CMD_ARCHIVE_GET => true,
+ &CMD_ARCHIVE_PUSH => true,
+ &CMD_BACKUP => true,
+ &CMD_INFO => true,
+ &CMD_RESTORE => true
+ }
+ },
+
+ # LOG Section
+ #-------------------------------------------------------------------------------------------------------------------------------
&OPTION_LOG_LEVEL_CONSOLE =>
{
&OPTION_RULE_TYPE => OPTION_TYPE_STRING,
@@ -921,50 +917,157 @@ my %oOptionRule =
}
},
- &OPTION_TABLESPACE =>
+ # ARCHIVE Section
+ #-------------------------------------------------------------------------------------------------------------------------------
+ &OPTION_ARCHIVE_ASYNC =>
{
&OPTION_RULE_TYPE => OPTION_TYPE_BOOLEAN,
- &OPTION_RULE_DEFAULT => OPTION_DEFAULT_RESTORE_TABLESPACE,
- &OPTION_RULE_SECTION => true,
+ &OPTION_RULE_DEFAULT => OPTION_DEFAULT_ARCHIVE_ASYNC,
+ &OPTION_RULE_SECTION => CONFIG_SECTION_ARCHIVE,
&OPTION_RULE_COMMAND =>
{
- &CMD_RESTORE => true
+ &CMD_ARCHIVE_PUSH => true
}
},
- &OPTION_RESTORE_TABLESPACE_MAP =>
+ &OPTION_ARCHIVE_MAX_MB =>
{
- &OPTION_RULE_TYPE => OPTION_TYPE_HASH,
+ &OPTION_RULE_TYPE => OPTION_TYPE_INTEGER,
&OPTION_RULE_REQUIRED => false,
- &OPTION_RULE_SECTION => CONFIG_SECTION_RESTORE_TABLESPACE_MAP,
+ &OPTION_RULE_SECTION => CONFIG_SECTION_ARCHIVE,
&OPTION_RULE_COMMAND =>
{
- &CMD_RESTORE => 1
- },
+ &CMD_ARCHIVE_PUSH => true
+ }
},
- &OPTION_RESTORE_RECOVERY_SETTING =>
+ # BACKUP Section
+ #-------------------------------------------------------------------------------------------------------------------------------
+ &OPTION_BACKUP_ARCHIVE_CHECK =>
{
- &OPTION_RULE_TYPE => OPTION_TYPE_HASH,
- &OPTION_RULE_REQUIRED => false,
- &OPTION_RULE_SECTION => CONFIG_SECTION_RESTORE_RECOVERY_SETTING,
+ &OPTION_RULE_TYPE => OPTION_TYPE_BOOLEAN,
+ &OPTION_RULE_DEFAULT => OPTION_DEFAULT_BACKUP_ARCHIVE_CHECK,
+ &OPTION_RULE_SECTION => true,
&OPTION_RULE_COMMAND =>
{
- &CMD_RESTORE => 1
- },
- &OPTION_RULE_DEPEND =>
- {
- &OPTION_RULE_DEPEND_OPTION => OPTION_TYPE,
- &OPTION_RULE_DEPEND_LIST =>
+ &CMD_BACKUP =>
{
- &RECOVERY_TYPE_DEFAULT => true,
- &RECOVERY_TYPE_NAME => true,
- &RECOVERY_TYPE_TIME => true,
- &RECOVERY_TYPE_XID => true
+ &OPTION_RULE_DEPEND =>
+ {
+ &OPTION_RULE_DEPEND_OPTION => OPTION_NO_START_STOP,
+ &OPTION_RULE_DEPEND_VALUE => false
+ }
}
}
},
+ &OPTION_BACKUP_ARCHIVE_COPY =>
+ {
+ &OPTION_RULE_TYPE => OPTION_TYPE_BOOLEAN,
+ &OPTION_RULE_DEFAULT => OPTION_DEFAULT_BACKUP_ARCHIVE_COPY,
+ &OPTION_RULE_SECTION => true,
+ &OPTION_RULE_COMMAND =>
+ {
+ &CMD_BACKUP =>
+ {
+ &OPTION_RULE_DEPEND =>
+ {
+ &OPTION_RULE_DEPEND_OPTION => OPTION_BACKUP_ARCHIVE_CHECK,
+ &OPTION_RULE_DEPEND_VALUE => true
+ }
+ }
+ }
+ },
+
+ &OPTION_BACKUP_HOST =>
+ {
+ &OPTION_RULE_TYPE => OPTION_TYPE_STRING,
+ &OPTION_RULE_REQUIRED => false,
+ &OPTION_RULE_SECTION => CONFIG_SECTION_BACKUP,
+ &OPTION_RULE_COMMAND =>
+ {
+ &CMD_ARCHIVE_GET => true,
+ &CMD_ARCHIVE_PUSH => true,
+ &CMD_INFO => true,
+ &CMD_RESTORE => true
+ },
+ },
+
+ &OPTION_BACKUP_USER =>
+ {
+ &OPTION_RULE_TYPE => OPTION_TYPE_STRING,
+ &OPTION_RULE_SECTION => CONFIG_SECTION_BACKUP,
+ &OPTION_RULE_COMMAND =>
+ {
+ &CMD_ARCHIVE_GET => true,
+ &CMD_ARCHIVE_PUSH => true,
+ &CMD_INFO => true,
+ &CMD_RESTORE => true
+ },
+ &OPTION_RULE_REQUIRED => false,
+ &OPTION_RULE_DEPEND =>
+ {
+ &OPTION_RULE_DEPEND_OPTION => OPTION_BACKUP_HOST
+ }
+ },
+
+ &OPTION_HARDLINK =>
+ {
+ &OPTION_RULE_TYPE => OPTION_TYPE_BOOLEAN,
+ &OPTION_RULE_DEFAULT => OPTION_DEFAULT_BACKUP_HARDLINK,
+ &OPTION_RULE_SECTION => true,
+ &OPTION_RULE_COMMAND =>
+ {
+ &CMD_BACKUP => true
+ }
+ },
+
+ &OPTION_MANIFEST_SAVE_THRESHOLD =>
+ {
+ &OPTION_RULE_TYPE => OPTION_TYPE_INTEGER,
+ &OPTION_RULE_DEFAULT => OPTION_DEFAULT_BACKUP_MANIFEST_SAVE_THRESHOLD,
+ &OPTION_RULE_SECTION => true,
+ &OPTION_RULE_COMMAND =>
+ {
+ &CMD_BACKUP => true
+ }
+ },
+
+ &OPTION_RESUME =>
+ {
+ &OPTION_RULE_TYPE => OPTION_TYPE_BOOLEAN,
+ &OPTION_RULE_DEFAULT => OPTION_DEFAULT_BACKUP_RESUME,
+ &OPTION_RULE_SECTION => true,
+ &OPTION_RULE_COMMAND =>
+ {
+ &CMD_BACKUP => true
+ }
+ },
+
+ &OPTION_START_FAST =>
+ {
+ &OPTION_RULE_TYPE => OPTION_TYPE_BOOLEAN,
+ &OPTION_RULE_DEFAULT => OPTION_DEFAULT_BACKUP_START_FAST,
+ &OPTION_RULE_SECTION => true,
+ &OPTION_RULE_COMMAND =>
+ {
+ &CMD_BACKUP => true
+ }
+ },
+
+ &OPTION_STOP_AUTO =>
+ {
+ &OPTION_RULE_TYPE => OPTION_TYPE_BOOLEAN,
+ &OPTION_RULE_DEFAULT => OPTION_DEFAULT_BACKUP_STOP_AUTO,
+ &OPTION_RULE_SECTION => true,
+ &OPTION_RULE_COMMAND =>
+ {
+ &CMD_BACKUP => true
+ }
+ },
+
+ # EXPIRE Section
+ #-------------------------------------------------------------------------------------------------------------------------------
&OPTION_RETENTION_ARCHIVE =>
{
&OPTION_RULE_TYPE => OPTION_TYPE_INTEGER,
@@ -1027,69 +1130,90 @@ my %oOptionRule =
}
},
- &OPTION_MANIFEST_SAVE_THRESHOLD =>
- {
- &OPTION_RULE_TYPE => OPTION_TYPE_INTEGER,
- &OPTION_RULE_DEFAULT => OPTION_DEFAULT_BACKUP_MANIFEST_SAVE_THRESHOLD,
- &OPTION_RULE_SECTION => true,
- &OPTION_RULE_COMMAND =>
- {
- &CMD_BACKUP => true
- }
- },
+ # RESTORE Section
+ #-------------------------------------------------------------------------------------------------------------------------------
- &OPTION_RESUME =>
+ &OPTION_TABLESPACE =>
{
&OPTION_RULE_TYPE => OPTION_TYPE_BOOLEAN,
- &OPTION_RULE_DEFAULT => OPTION_DEFAULT_BACKUP_RESUME,
+ &OPTION_RULE_DEFAULT => OPTION_DEFAULT_RESTORE_TABLESPACE,
&OPTION_RULE_SECTION => true,
&OPTION_RULE_COMMAND =>
{
- &CMD_BACKUP => true
- }
- },
-
- &OPTION_STOP_AUTO =>
- {
- &OPTION_RULE_TYPE => OPTION_TYPE_BOOLEAN,
- &OPTION_RULE_DEFAULT => OPTION_DEFAULT_BACKUP_STOP_AUTO,
- &OPTION_RULE_SECTION => true,
- &OPTION_RULE_COMMAND =>
- {
- &CMD_BACKUP => true
- }
- },
-
- &OPTION_START_FAST =>
- {
- &OPTION_RULE_TYPE => OPTION_TYPE_BOOLEAN,
- &OPTION_RULE_DEFAULT => OPTION_DEFAULT_BACKUP_START_FAST,
- &OPTION_RULE_SECTION => true,
- &OPTION_RULE_COMMAND =>
- {
- &CMD_BACKUP => true
- }
- },
-
- &OPTION_THREAD_MAX =>
- {
- &OPTION_RULE_TYPE => OPTION_TYPE_INTEGER,
- &OPTION_RULE_DEFAULT => OPTION_DEFAULT_THREAD_MAX,
- &OPTION_RULE_SECTION => true,
- &OPTION_RULE_SECTION_INHERIT => CONFIG_SECTION_GENERAL,
- &OPTION_RULE_COMMAND =>
- {
- &CMD_BACKUP => true,
&CMD_RESTORE => true
}
},
- &OPTION_DB_TIMEOUT =>
+ &OPTION_RESTORE_TABLESPACE_MAP =>
+ {
+ &OPTION_RULE_TYPE => OPTION_TYPE_HASH,
+ &OPTION_RULE_REQUIRED => false,
+ &OPTION_RULE_SECTION => CONFIG_SECTION_RESTORE_TABLESPACE_MAP,
+ &OPTION_RULE_COMMAND =>
+ {
+ &CMD_RESTORE => 1
+ },
+ },
+
+ &OPTION_RESTORE_RECOVERY_SETTING =>
+ {
+ &OPTION_RULE_TYPE => OPTION_TYPE_HASH,
+ &OPTION_RULE_REQUIRED => false,
+ &OPTION_RULE_SECTION => CONFIG_SECTION_RESTORE_RECOVERY_SETTING,
+ &OPTION_RULE_COMMAND =>
+ {
+ &CMD_RESTORE => 1
+ },
+ &OPTION_RULE_DEPEND =>
+ {
+ &OPTION_RULE_DEPEND_OPTION => OPTION_TYPE,
+ &OPTION_RULE_DEPEND_LIST =>
+ {
+ &RECOVERY_TYPE_DEFAULT => true,
+ &RECOVERY_TYPE_NAME => true,
+ &RECOVERY_TYPE_TIME => true,
+ &RECOVERY_TYPE_XID => true
+ }
+ }
+ },
+
+ # STANZA Section
+ #-------------------------------------------------------------------------------------------------------------------------------
+ &OPTION_DB_HOST =>
+ {
+ &OPTION_RULE_TYPE => OPTION_TYPE_STRING,
+ &OPTION_RULE_REQUIRED => false,
+ &OPTION_RULE_SECTION => CONFIG_SECTION_STANZA,
+ &OPTION_RULE_COMMAND =>
+ {
+ &CMD_BACKUP => true
+ }
+ },
+
+ &OPTION_DB_PATH =>
+ {
+ &OPTION_RULE_TYPE => OPTION_TYPE_STRING,
+ &OPTION_RULE_SECTION => CONFIG_SECTION_STANZA,
+ &OPTION_RULE_HINT => "Does this stanza exist?",
+ &OPTION_RULE_COMMAND =>
+ {
+ &CMD_ARCHIVE_GET =>
+ {
+ &OPTION_RULE_REQUIRED => false
+ },
+ &CMD_ARCHIVE_PUSH =>
+ {
+ &OPTION_RULE_REQUIRED => false
+ },
+ &CMD_BACKUP => true
+ },
+ },
+
+ &OPTION_DB_PORT =>
{
&OPTION_RULE_TYPE => OPTION_TYPE_INTEGER,
- &OPTION_RULE_DEFAULT => OPTION_DEFAULT_DB_TIMEOUT,
- &OPTION_RULE_SECTION => true,
- &OPTION_RULE_SECTION_INHERIT => CONFIG_SECTION_GENERAL,
+ &OPTION_RULE_DEFAULT => OPTION_DEFAULT_DB_PORT,
+ &OPTION_RULE_SECTION => CONFIG_SECTION_STANZA,
&OPTION_RULE_COMMAND =>
{
&CMD_BACKUP => true,
@@ -1097,45 +1221,31 @@ my %oOptionRule =
}
},
- &OPTION_THREAD_TIMEOUT =>
+ &OPTION_DB_SOCKET_PATH =>
{
- &OPTION_RULE_TYPE => OPTION_TYPE_INTEGER,
+ &OPTION_RULE_TYPE => OPTION_TYPE_STRING,
&OPTION_RULE_REQUIRED => false,
- &OPTION_RULE_SECTION => true,
- &OPTION_RULE_SECTION_INHERIT => CONFIG_SECTION_BACKUP,
+ &OPTION_RULE_SECTION => CONFIG_SECTION_STANZA,
&OPTION_RULE_COMMAND =>
{
&CMD_BACKUP => true,
- &CMD_RESTORE => true
+ &CMD_REMOTE => true
}
},
- # Command-line-only test option rules
- #-------------------------------------------------------------------------------------------------------------------------------
- &OPTION_TEST =>
+ &OPTION_DB_USER =>
{
- &OPTION_RULE_TYPE => OPTION_TYPE_BOOLEAN,
- &OPTION_RULE_DEFAULT => OPTION_DEFAULT_TEST
- },
-
- &OPTION_TEST_DELAY =>
- {
- &OPTION_RULE_TYPE => OPTION_TYPE_FLOAT,
- &OPTION_RULE_DEFAULT => OPTION_DEFAULT_TEST_DELAY,
+ &OPTION_RULE_TYPE => OPTION_TYPE_STRING,
+ &OPTION_RULE_DEFAULT => OPTION_DEFAULT_DB_USER,
+ &OPTION_RULE_SECTION => CONFIG_SECTION_STANZA,
+ &OPTION_RULE_COMMAND =>
+ {
+ &CMD_BACKUP => true
+ },
+ &OPTION_RULE_REQUIRED => false,
&OPTION_RULE_DEPEND =>
{
- &OPTION_RULE_DEPEND_OPTION => OPTION_TEST,
- &OPTION_RULE_DEPEND_VALUE => true
- }
- },
-
- &OPTION_TEST_NO_FORK =>
- {
- &OPTION_RULE_TYPE => OPTION_TYPE_BOOLEAN,
- &OPTION_RULE_DEFAULT => OPTION_DEFAULT_TEST_NO_FORK,
- &OPTION_RULE_DEPEND =>
- {
- &OPTION_RULE_DEPEND_OPTION => OPTION_TEST
+ &OPTION_RULE_DEPEND_OPTION => OPTION_DB_HOST
}
}
);
@@ -1323,6 +1433,8 @@ sub configLoad
}
}
+push @EXPORT, qw(configLoad);
+
####################################################################################################################################
# optionValid
#
@@ -1768,6 +1880,8 @@ sub optionRequired
return !defined($bRequired) || $bRequired;
}
+push @EXPORT, qw(optionRequired);
+
####################################################################################################################################
# optionDefault
#
@@ -1788,39 +1902,7 @@ sub optionDefault
return defined($strDefault) ? $strDefault : $oOptionRule{$strOption}{&OPTION_RULE_DEFAULT};
}
-####################################################################################################################################
-# commandGet
-#
-# Get the current command.
-####################################################################################################################################
-sub commandGet
-{
- return $strCommand;
-}
-
-####################################################################################################################################
-# commandTest
-#
-# Test the current command.
-####################################################################################################################################
-sub commandTest
-{
- my $strCommandTest = shift;
-
- return $strCommandTest eq $strCommand;
-}
-
-####################################################################################################################################
-# commandSet
-#
-# Set current command (usually for triggering follow-on commands).
-####################################################################################################################################
-sub commandSet
-{
- my $strValue = shift;
-
- $strCommand = $strValue;
-}
+push @EXPORT, qw(optionDefault);
####################################################################################################################################
# optionGet
@@ -1840,64 +1922,7 @@ sub optionGet
return $oOption{$strOption}{value};
}
-####################################################################################################################################
-# commandWrite
-#
-# Using the options that were passed to the current command, write the command string for another command. For example, this
-# can be used to write the archive-get command for recovery.conf during a restore.
-####################################################################################################################################
-sub commandWrite
-{
- my $strNewCommand = shift;
- my $bIncludeConfig = shift;
- my $strCommandString = shift;
-
- $strCommandString = defined($strCommandString) ? $strCommandString : abs_path($0);
-
- # If config setting are included then also set --no-config
- $bIncludeConfig = defined($bIncludeConfig) ? $bIncludeConfig : false;
-
- if ($bIncludeConfig)
- {
- $strCommandString .= ' --no-config';
- }
-
- foreach my $strOption (sort(keys(%oOption)))
- {
- next if ($bIncludeConfig && $strOption eq OPTION_CONFIG);
-
- # &log(WARN, "option ${strOption} = " . (defined($oOption{$strOption}{source}) ? $oOption{$strOption}{source} : 'undef') .
- # ", " . (defined($oOption{$strOption}{value}) ? $oOption{$strOption}{value} : 'undef'));
-
- if ((!defined($oOptionRule{$strOption}{&OPTION_RULE_COMMAND}) ||
- defined($oOptionRule{$strOption}{&OPTION_RULE_COMMAND}{$strNewCommand})) &&
- defined($oOption{$strOption}{value}) &&
- ($bIncludeConfig ? $oOption{$strOption}{source} ne SOURCE_DEFAULT : $oOption{$strOption}{source} eq SOURCE_PARAM))
- {
- my $strParam;
-
- if ($oOptionRule{$strOption}{&OPTION_RULE_TYPE} eq OPTION_TYPE_BOOLEAN)
- {
- $strParam = '--' . ($oOption{$strOption}{value} ? '' : 'no-') . $strOption;
- }
- else
- {
- $strParam = "--${strOption}=$oOption{$strOption}{value}";
- }
-
- if (index($oOption{$strOption}{value}, " ") != -1)
- {
- $strCommandString .= " \"${strParam}\"";
- }
- else
- {
- $strCommandString .= " ${strParam}";
- }
- }
- }
-
- $strCommandString .= " ${strNewCommand}";
-}
+push @EXPORT, qw(optionGet);
####################################################################################################################################
# optionTest
@@ -1917,6 +1942,21 @@ sub optionTest
return defined($oOption{$strOption}{value});
}
+push @EXPORT, qw(optionTest);
+
+####################################################################################################################################
+# optionRuleGet
+#
+# Get the option rules.
+####################################################################################################################################
+sub optionRuleGet
+{
+ use Storable qw(dclone);
+ return dclone(\%oOptionRule);
+}
+
+push @EXPORT, qw(optionRuleGet);
+
####################################################################################################################################
# optionRemoteType
#
@@ -1927,6 +1967,8 @@ sub optionRemoteType
return $strRemoteType;
}
+push @EXPORT, qw(optionRemoteType);
+
####################################################################################################################################
# optionRemoteTypeTest
#
@@ -1939,6 +1981,20 @@ sub optionRemoteTypeTest
return $strRemoteType eq $strTest ? true : false;
}
+push @EXPORT, qw(optionRemoteTypeTest);
+
+####################################################################################################################################
+# optionRemoteTest
+#
+# Test if the remote DB or BACKUP.
+####################################################################################################################################
+sub optionRemoteTest
+{
+ return $strRemoteType ne NONE ? true : false;
+}
+
+push @EXPORT, qw(optionRemoteTest);
+
####################################################################################################################################
# protocolGet
#
@@ -1987,6 +2043,8 @@ sub protocolGet
return $oProtocolTemp;
}
+push @EXPORT, qw(protocolGet);
+
####################################################################################################################################
# protocolDestroy
#
@@ -2000,25 +2058,157 @@ sub protocolDestroy
}
}
-####################################################################################################################################
-# optionRemoteTest
-#
-# Test if the remote DB or BACKUP.
-####################################################################################################################################
-sub optionRemoteTest
-{
- return $strRemoteType ne NONE ? true : false;
-}
+push @EXPORT, qw(protocolDestroy);
####################################################################################################################################
-# optionRuleGet
+# commandGet
#
-# Get the option rules.
+# Get the current command.
####################################################################################################################################
-sub optionRuleGet
+sub commandGet
{
- use Storable qw(dclone);
- return dclone(\%oOptionRule);
+ return $strCommand;
}
+push @EXPORT, qw(commandGet);
+
+####################################################################################################################################
+# commandTest
+#
+# Test the current command.
+####################################################################################################################################
+sub commandTest
+{
+ my $strCommandTest = shift;
+
+ return $strCommandTest eq $strCommand;
+}
+
+push @EXPORT, qw(commandTest);
+
+####################################################################################################################################
+# commandStart
+#
+# Log information about the command that was just started.
+####################################################################################################################################
+sub commandStart
+{
+ &log($strCommand eq CMD_INFO ? DEBUG : INFO, "${strCommand} start:" . commandWrite($strCommand, true, '', false))
+}
+
+push @EXPORT, qw(commandStart);
+
+####################################################################################################################################
+# commandStop
+#
+# Log information about the command that was just stopped.
+####################################################################################################################################
+sub commandStop
+{
+ &log($strCommand eq CMD_INFO ? DEBUG : INFO, "${strCommand} stop")
+}
+
+push @EXPORT, qw(commandStop);
+
+####################################################################################################################################
+# commandSet
+#
+# Set current command (usually for triggering follow-on commands).
+####################################################################################################################################
+sub commandSet
+{
+ my $strValue = shift;
+
+ commandStop();
+
+ $strCommand = $strValue;
+
+ commandStart();
+}
+
+push @EXPORT, qw(commandSet);
+
+####################################################################################################################################
+# commandWrite
+#
+# Using the options that were passed to the current command, write the command string for another command. For example, this
+# can be used to write the archive-get command for recovery.conf during a restore.
+####################################################################################################################################
+sub commandWrite
+{
+ my $strNewCommand = shift;
+ my $bIncludeConfig = shift;
+ my $strExeString = shift;
+ my $bIncludeCommand = shift;
+
+ # Set defaults
+ $strExeString = defined($strExeString) ? $strExeString : abs_path($0);
+ $bIncludeConfig = defined($bIncludeConfig) ? $bIncludeConfig : false;
+ $bIncludeCommand = defined($bIncludeCommand) ? $bIncludeCommand : true;
+
+ if ($bIncludeConfig && $strExeString ne '')
+ {
+ $strExeString .= ' --no-config';
+ }
+
+ foreach my $strOption (sort(keys(%oOption)))
+ {
+ next if ($bIncludeConfig && $strOption eq OPTION_CONFIG);
+
+ # &log(WARN, "option ${strOption} = " . (defined($oOption{$strOption}{source}) ? $oOption{$strOption}{source} : 'undef') .
+ # ", " . (defined($oOption{$strOption}{value}) ? $oOption{$strOption}{value} : 'undef'));
+
+ if ((!defined($oOptionRule{$strOption}{&OPTION_RULE_COMMAND}) ||
+ defined($oOptionRule{$strOption}{&OPTION_RULE_COMMAND}{$strNewCommand})) &&
+ defined($oOption{$strOption}{value}) &&
+ ($bIncludeConfig ? $oOption{$strOption}{source} ne SOURCE_DEFAULT : $oOption{$strOption}{source} eq SOURCE_PARAM))
+ {
+ my $strParam;
+ my $oValue;
+ my $bHash = false;
+
+ # If this is a hash then it will break up into multple command-line options
+ if (ref($oOption{$strOption}{value}) eq 'HASH')
+ {
+ $oValue = $oOption{$strOption}{value};
+ $bHash = true;
+ }
+ # Else a single value but store it in a hash anyway to make processing below simpler
+ else
+ {
+ $oValue = {value => $oOption{$strOption}{value}};
+ }
+
+ # Loops though all keys in the hash
+ foreach my $strKey (sort(keys(%$oValue)))
+ {
+ # Get the value - if the original value was a hash then the key must be prefixed
+ my $strValue = ($bHash ? "${strKey}=" : '') . $$oValue{$strKey};
+
+ # Handle the no- prefix for boolean values
+ if ($oOptionRule{$strOption}{&OPTION_RULE_TYPE} eq OPTION_TYPE_BOOLEAN)
+ {
+ $strParam = '--' . ($strValue ? '' : 'no-') . $strOption;
+ }
+ else
+ {
+ $strParam = "--${strOption}=${strValue}";
+ }
+
+ # Add quotes if the value has spaces in it
+ $strExeString .= ' ' . (index($strValue, " ") != -1 ? "\"${strParam}\"" : $strParam);
+ }
+ }
+ }
+
+ if ($bIncludeCommand)
+ {
+ $strExeString .= " ${strNewCommand}";
+ }
+
+ return $strExeString;
+}
+
+push @EXPORT, qw(commandWrite);
+
1;
diff --git a/lib/BackRest/Db.pm b/lib/BackRest/Db.pm
index 830f81c90..459d28bc4 100644
--- a/lib/BackRest/Db.pm
+++ b/lib/BackRest/Db.pm
@@ -15,10 +15,12 @@ use Fcntl qw(O_RDONLY);
use File::Basename qw(dirname);
use lib dirname($0);
+use BackRest::Common::Exception;
+use BackRest::Common::Log;
+use BackRest::Common::String;
+use BackRest::Common::Wait;
use BackRest::Config;
-use BackRest::Exception;
use BackRest::File;
-use BackRest::Utility;
####################################################################################################################################
# Operation constants
@@ -28,12 +30,16 @@ use constant OP_DB => 'Db';
use constant OP_DB_NEW => OP_DB . "->new";
use constant OP_DB_BACKUP_START => OP_DB . "->backupStart";
use constant OP_DB_BACKUP_STOP => OP_DB . "->backupStop";
+use constant OP_DB_DESTROY => OP_DB . "->DESTROY";
use constant OP_DB_EXECUTE_SQL => OP_DB . "->executeSql";
push @EXPORT, qw(OP_DB_EXECUTE_SQL);
+use constant OP_DB_EXECUTE_SQL_ONE => OP_DB . "->executeSqlOne";
+use constant OP_DB_EXECUTE_SQL_ROW => OP_DB . "->executeSqlRow";
use constant OP_DB_INFO => OP_DB . "->info";
push @EXPORT, qw(OP_DB_INFO);
use constant OP_DB_TABLESPACE_MAP_GET => OP_DB . "->tablespaceMapGet";
use constant OP_DB_VERSION_GET => OP_DB . "->versionGet";
+use constant OP_DB_VERSION_SUPPORT => OP_DB . "->versionSupport";
####################################################################################################################################
# Postmaster process Id file
@@ -58,7 +64,21 @@ sub new
my $self = {};
bless $self, $class;
- return $self;
+ # Assign function parameters, defaults, and log debug info
+ (
+ my $strOperation
+ ) =
+ logDebugParam
+ (
+ OP_DB_NEW
+ );
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'self', value => $self}
+ );
}
####################################################################################################################################
@@ -68,11 +88,27 @@ sub DESTROY
{
my $self = shift;
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation
+ ) =
+ logDebugParam
+ (
+ OP_DB_DESTROY
+ );
+
if (defined($self->{hDb}))
{
$self->{hDb}->disconnect();
undef($self->{hDb});
}
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation
+ );
}
####################################################################################################################################
@@ -82,9 +118,24 @@ sub DESTROY
####################################################################################################################################
sub versionSupport
{
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation
+ ) =
+ logDebugParam
+ (
+ OP_DB_VERSION_SUPPORT
+ );
+
my @strySupportVersion = ('8.3', '8.4', '9.0', '9.1', '9.2', '9.3', '9.4', '9.5');
- return \@strySupportVersion;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'strySupportVersion', value => \@strySupportVersion}
+ );
}
push @EXPORT, qw(versionSupport);
@@ -95,10 +146,20 @@ push @EXPORT, qw(versionSupport);
sub executeSql
{
my $self = shift;
- my $strSql = shift;
- my $bIgnoreError = shift;
- logDebug(OP_DB_EXECUTE_SQL, DEBUG_CALL, undef, {isRemote => optionRemoteTypeTest(DB), script => \$strSql});
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strSql,
+ $bIgnoreError
+ ) =
+ logDebugParam
+ (
+ OP_DB_EXECUTE_SQL, \@_,
+ {name => 'strSql'},
+ {name => 'bIgnoreError', default => false}
+ );
# Get the user-defined command for psql
my $strResult;
@@ -110,11 +171,7 @@ sub executeSql
my %oParamHash;
$oParamHash{'script'} = $strSql;
-
- if (defined($bIgnoreError) && $bIgnoreError)
- {
- $oParamHash{'ignore-error'} = true;
- }
+ $oParamHash{'ignore-error'} = $bIgnoreError;
# Execute the command
$strResult = protocolGet()->cmdExecute(OP_DB_EXECUTE_SQL, \%oParamHash, true);
@@ -138,7 +195,12 @@ sub executeSql
my $strDbUri = "dbi:Pg:dbname=${strDbName};port=" . optionGet(OPTION_DB_PORT) .
(optionTest(OPTION_DB_SOCKET_PATH) ? ';host=' . optionGet(OPTION_DB_SOCKET_PATH) : '');
- logDebug(OP_DB_EXECUTE_SQL, DEBUG_MISC, 'db connect', {strDbUri => $strDbUri, strDbUser => $strDbUser});
+ logDebugMisc
+ (
+ $strOperation, 'db connect',
+ {name => 'strDbUri', value => $strDbUri},
+ {name => 'strDbUser', value => $strDbUser}
+ );
$self->{hDb} = DBI->connect($strDbUri, $strDbUser, undef, {AutoCommit => 1, RaiseError => 0, PrintError => 0});
@@ -156,8 +218,7 @@ sub executeSql
$hStatement->execute();
# Wait for the query to return
- my $iWaitSeconds = optionGet(OPTION_DB_TIMEOUT);
- my $oExecuteWait = waitInit($iWaitSeconds);
+ my $oWait = waitInit(optionGet(OPTION_DB_TIMEOUT));
my $bTimeout = true;
do
@@ -168,7 +229,7 @@ sub executeSql
if (!$hStatement->pg_result())
{
# Return if the error should be ignored
- if (defined($bIgnoreError) && $bIgnoreError)
+ if ($bIgnoreError)
{
return '';
}
@@ -195,19 +256,23 @@ sub executeSql
$bTimeout = false;
}
- } while ($bTimeout && waitMore($oExecuteWait));
+ } while ($bTimeout && waitMore($oWait));
# If timeout then cancel the query and confess
if ($bTimeout)
{
$hStatement->pg_cancel();
- confess &log(ERROR, "statement timed out after ${iWaitSeconds} second(s):\n${strSql}", ERROR_DB_TIMEOUT);
+ confess &log(ERROR, 'statement timed out after ' . waitInterval($oWait) .
+ " second(s):\n${strSql}", ERROR_DB_TIMEOUT);
}
}
- logDebug(OP_DB_EXECUTE_SQL, DEBUG_RESULT, undef, {strResult => $strResult});
-
- return $strResult;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'strResult', value => $strResult}
+ );
}
####################################################################################################################################
@@ -216,9 +281,28 @@ sub executeSql
sub executeSqlRow
{
my $self = shift;
- my $strSql = shift;
- return split("\t", trim($self->executeSql($strSql)));
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strSql
+ ) =
+ logDebugParam
+ (
+ OP_DB_EXECUTE_SQL_ROW, \@_,
+ {name => 'strSql', trace => true}
+ );
+
+ # Return from function and log return values if any
+ my @stryResult = split("\t", trim($self->executeSql($strSql)));
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'strResult', value => \@stryResult}
+ );
}
####################################################################################################################################
@@ -227,9 +311,25 @@ sub executeSqlRow
sub executeSqlOne
{
my $self = shift;
- my $strSql = shift;
- return ($self->executeSqlRow($strSql))[0];
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strSql
+ ) =
+ logDebugParam
+ (
+ OP_DB_EXECUTE_SQL_ONE, \@_,
+ {name => 'strSql', trace => true}
+ );
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'strResult', value => ($self->executeSqlRow($strSql))[0], trace => true}
+ );
}
####################################################################################################################################
@@ -241,14 +341,25 @@ sub tablespaceMapGet
{
my $self = shift;
- logTrace(OP_DB_TABLESPACE_MAP_GET, DEBUG_CALL);
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation
+ ) =
+ logDebugParam
+ (
+ OP_DB_TABLESPACE_MAP_GET
+ );
- my $oHashRef = {};
+ dataHashBuild(my $oTablespaceMapRef = {}, "oid\tname\n" . $self->executeSql(
+ 'select oid, spcname from pg_tablespace'), "\t");
- data_hash_build($oHashRef, "oid\tname\n" . $self->executeSql(
- 'select oid, spcname from pg_tablespace'), "\t");
-
- return $oHashRef;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'oTablespaceMapRef', value => $oTablespaceMapRef}
+ );
}
####################################################################################################################################
@@ -257,10 +368,20 @@ sub tablespaceMapGet
sub info
{
my $self = shift;
- my $oFile = shift;
- my $strDbPath = shift;
- logDebug(OP_DB_INFO, DEBUG_CALL, undef, {isRemote => $oFile->is_remote(PATH_DB_ABSOLUTE), dbPath => \$strDbPath});
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $oFile,
+ $strDbPath
+ ) =
+ logDebugParam
+ (
+ OP_DB_INFO, \@_,
+ {name => 'oFile'},
+ {name => 'strDbPath'}
+ );
# Return data from the cache if it exists
if (defined($self->{info}{$strDbPath}))
@@ -277,7 +398,7 @@ sub info
my $ullDbSysId;
my $fDbVersion;
- if ($oFile->is_remote(PATH_DB_ABSOLUTE))
+ if ($oFile->isRemote(PATH_DB_ABSOLUTE))
{
# Build param hash
my %oParamHash;
@@ -389,10 +510,15 @@ sub info
$self->{info}{$strDbPath}{iCatalogVersion} = $iCatalogVersion;
$self->{info}{$strDbPath}{ullDbSysId} = $ullDbSysId;
- &log(DEBUG, OP_DB_INFO . "=>: dbVersion = ${fDbVersion}, controlVersion = ${iControlVersion}" .
- ", catalogVersion = ${iCatalogVersion}, dbSysId = ${ullDbSysId}");
-
- return $fDbVersion, $iControlVersion, $iCatalogVersion, $ullDbSysId;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'fDbVersion', value => $fDbVersion},
+ {name => 'iControlVersion', value => $iControlVersion},
+ {name => 'iCatalogVersion', value => $iCatalogVersion},
+ {name => 'ullDbSysId', value => $ullDbSysId}
+ );
}
####################################################################################################################################
@@ -402,27 +528,41 @@ sub versionGet
{
my $self = shift;
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation
+ ) =
+ logDebugParam
+ (
+ OP_DB_VERSION_GET
+ );
+
# Get data from the cache if possible
- if (defined($self->{fVersion}) && defined($self->{strDbPath}))
+ if (defined($self->{fDbVersion}) && defined($self->{strDbPath}))
{
- return $self->{fVersion}, $self->{strDbPath};
+ return $self->{fDbVersion}, $self->{strDbPath};
}
# Get version and db-path from
- ($self->{fVersion}, $self->{strDbPath}) =
+ ($self->{fDbVersion}, $self->{strDbPath}) =
$self->executeSqlRow("select (regexp_matches(split_part(version(), ' ', 2), '^[0-9]+\.[0-9]+'))[1], setting" .
" from pg_settings where name = 'data_directory'");
- my $strVersionSupport = versionSupport();
+ my @stryVersionSupport = versionSupport();
- if ($self->{fVersion} < ${$strVersionSupport}[0])
+ if ($self->{fDbVersion} < $stryVersionSupport[0])
{
- confess &log(ERROR, "unsupported Postgres version ${$strVersionSupport}[0]", ERROR_VERSION_NOT_SUPPORTED);
+ confess &log(ERROR, 'unsupported Postgres version' . $self->{fDbVersion}, ERROR_VERSION_NOT_SUPPORTED);
}
- logDebug(OP_DB_VERSION_GET, DEBUG_RESULT, {dbVersion => $self->{fVersion}});
-
- return $self->{fVersion}, $self->{strDbPath};
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'fDbVersion', value => $self->{fDbVersion}},
+ {name => 'strDbPath', value => $self->{strDbPath}}
+ );
}
####################################################################################################################################
@@ -431,12 +571,24 @@ sub versionGet
sub backupStart
{
my $self = shift;
- my $oFile = shift;
- my $strDbPath = shift;
- my $strLabel = shift;
- my $bStartFast = shift;
- logDebug(OP_DB_BACKUP_START, DEBUG_CALL, undef, {dbPath => \$strDbPath, strLabel => \$strLabel, isStartFast => $bStartFast});
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $oFile,
+ $strDbPath,
+ $strLabel,
+ $bStartFast
+ ) =
+ logDebugParam
+ (
+ OP_DB_BACKUP_START, \@_,
+ {name => 'oFile'},
+ {name => 'strDbPath'},
+ {name => 'strLabel'},
+ {name => 'bStartFast'}
+ );
# Get the version from the control file
my ($fDbVersion) = $self->info($oFile, $strDbPath);
@@ -453,7 +605,7 @@ sub backupStart
}
# Only allow start-fast option for version >= 8.4
- if ($self->{fVersion} < 8.4 && $bStartFast)
+ if ($self->{fDbVersion} < 8.4 && $bStartFast)
{
&log(WARN, OPTION_START_FAST . ' option is only available in PostgreSQL >= 8.4');
$bStartFast = false;
@@ -469,7 +621,7 @@ sub backupStart
# Test if a backup is already running when version >= 9.3
if (optionGet(OPTION_STOP_AUTO))
{
- if ($self->{fVersion} >= 9.3)
+ if ($self->{fDbVersion} >= 9.3)
{
if ($self->executeSqlOne('select pg_is_in_backup()'))
{
@@ -484,7 +636,7 @@ sub backupStart
}
}
- &log(INFO, "executing pg_start_backup() with label \"${strLabel}\": backup will begin after " .
+ &log(INFO, "execute pg_start_backup() with label \"${strLabel}\": backup begins after " .
($bStartFast ? "the requested immediate checkpoint" : "the next regular checkpoint") . " completes");
my ($strTimestampDbStart, $strArchiveStart) =
@@ -492,7 +644,13 @@ sub backupStart
"pg_xlogfile_name(xlog) from pg_start_backup('${strLabel}'" .
($bStartFast ? ', true' : '') . ') as xlog');
- return $strArchiveStart, $strTimestampDbStart;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'strArchiveStart', value => $strArchiveStart},
+ {name => 'strTimestampDbStart', value => $strTimestampDbStart}
+ );
}
####################################################################################################################################
@@ -502,14 +660,29 @@ sub backupStop
{
my $self = shift;
- logDebug(OP_DB_BACKUP_STOP, DEBUG_CALL);
- &log(INFO, 'executing pg_stop_backup() and waiting for all WAL segments to be archived');
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation
+ ) =
+ logDebugParam
+ (
+ OP_DB_BACKUP_STOP
+ );
+
+ &log(INFO, 'execute pg_stop_backup() and wait for all WAL segments to archive');
my ($strTimestampDbStop, $strArchiveStop) =
$self->executeSqlRow("select to_char(clock_timestamp(), 'YYYY-MM-DD HH24:MI:SS.US TZ')," .
" pg_xlogfile_name(xlog) from pg_stop_backup() as xlog");
- return $strArchiveStop, $strTimestampDbStop;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'strArchiveStop', value => $strArchiveStop},
+ {name => 'strTimestampDbStop', value => $strTimestampDbStop}
+ );
}
1;
diff --git a/lib/BackRest/Exception.pm b/lib/BackRest/Exception.pm
deleted file mode 100644
index 13e88db46..000000000
--- a/lib/BackRest/Exception.pm
+++ /dev/null
@@ -1,116 +0,0 @@
-####################################################################################################################################
-# EXCEPTION MODULE
-####################################################################################################################################
-package BackRest::Exception;
-
-use strict;
-use warnings FATAL => qw(all);
-use Carp qw(confess longmess);
-
-use Exporter qw(import);
-
-####################################################################################################################################
-# Exception Codes
-####################################################################################################################################
-use constant
-{
- ERROR_ASSERT => 100,
- ERROR_CHECKSUM => 101,
- ERROR_CONFIG => 102,
- ERROR_FILE_INVALID => 103,
- ERROR_FORMAT => 104,
- ERROR_COMMAND_REQUIRED => 105,
- ERROR_OPTION_INVALID => 106,
- ERROR_OPTION_INVALID_VALUE => 107,
- ERROR_OPTION_INVALID_RANGE => 108,
- ERROR_OPTION_INVALID_PAIR => 109,
- ERROR_OPTION_DUPLICATE_KEY => 110,
- ERROR_OPTION_NEGATE => 111,
- ERROR_OPTION_REQUIRED => 112,
- ERROR_POSTMASTER_RUNNING => 113,
- ERROR_PROTOCOL => 114,
- ERROR_RESTORE_PATH_NOT_EMPTY => 115,
- ERROR_FILE_OPEN => 116,
- ERROR_FILE_READ => 117,
- ERROR_PARAM_REQUIRED => 118,
- ERROR_ARCHIVE_MISMATCH => 119,
- ERROR_ARCHIVE_DUPLICATE => 120,
- ERROR_VERSION_NOT_SUPPORTED => 121,
- ERROR_PATH_CREATE => 122,
- ERROR_COMMAND_INVALID => 123,
- ERROR_HOST_CONNECT => 124,
- ERROR_LOCK_ACQUIRE => 125,
- ERROR_BACKUP_MISMATCH => 126,
- ERROR_FILE_SYNC => 127,
- ERROR_PATH_OPEN => 128,
- ERROR_PATH_SYNC => 129,
- ERROR_FILE_MISSING => 130,
- ERROR_DB_CONNECT => 131,
- ERROR_DB_QUERY => 132,
- ERROR_DB_MISMATCH => 133,
- ERROR_DB_TIMEOUT => 134,
-
- ERROR_UNKNOWN => 199
-};
-
-our @EXPORT = qw(ERROR_ASSERT ERROR_CHECKSUM ERROR_CONFIG ERROR_FILE_INVALID ERROR_FORMAT ERROR_COMMAND_REQUIRED
- ERROR_OPTION_INVALID ERROR_OPTION_INVALID_VALUE ERROR_OPTION_INVALID_RANGE ERROR_OPTION_INVALID_PAIR
- ERROR_OPTION_DUPLICATE_KEY ERROR_OPTION_NEGATE ERROR_OPTION_REQUIRED ERROR_POSTMASTER_RUNNING ERROR_PROTOCOL
- ERROR_RESTORE_PATH_NOT_EMPTY ERROR_FILE_OPEN ERROR_FILE_READ ERROR_PARAM_REQUIRED ERROR_ARCHIVE_MISMATCH
- ERROR_ARCHIVE_DUPLICATE ERROR_VERSION_NOT_SUPPORTED ERROR_PATH_CREATE ERROR_COMMAND_INVALID ERROR_HOST_CONNECT
- ERROR_UNKNOWN ERROR_LOCK_ACQUIRE ERROR_BACKUP_MISMATCH ERROR_FILE_SYNC ERROR_PATH_OPEN ERROR_PATH_SYNC
- ERROR_FILE_MISSING ERROR_DB_CONNECT ERROR_DB_QUERY ERROR_DB_MISMATCH ERROR_DB_TIMEOUT);
-
-####################################################################################################################################
-# CONSTRUCTOR
-####################################################################################################################################
-sub new
-{
- my $class = shift; # Class name
- my $iCode = shift; # Error code
- my $strMessage = shift; # ErrorMessage
- my $strTrace = shift; # Stack trace
-
- # Create the class hash
- my $self = {};
- bless $self, $class;
-
- # Initialize exception
- $self->{iCode} = $iCode;
- $self->{strMessage} = $strMessage;
- $self->{strTrace} = $strTrace;
-
- return $self;
-}
-
-####################################################################################################################################
-# CODE
-####################################################################################################################################
-sub code
-{
- my $self = shift;
-
- return $self->{iCode};
-}
-
-####################################################################################################################################
-# MESSAGE
-####################################################################################################################################
-sub message
-{
- my $self = shift;
-
- return $self->{strMessage};
-}
-
-####################################################################################################################################
-# TRACE
-####################################################################################################################################
-sub trace
-{
- my $self = shift;
-
- return $self->{strTrace};
-}
-
-1;
diff --git a/lib/BackRest/Expire.pm b/lib/BackRest/Expire.pm
new file mode 100644
index 000000000..5d63e75e4
--- /dev/null
+++ b/lib/BackRest/Expire.pm
@@ -0,0 +1,286 @@
+####################################################################################################################################
+# EXPIRE MODULE
+####################################################################################################################################
+package BackRest::Expire;
+
+use threads;
+use strict;
+use warnings FATAL => qw(all);
+use Carp qw(confess);
+
+use Exporter qw(import);
+use File::Basename qw(dirname);
+use File::Path qw(remove_tree);
+use Scalar::Util qw(looks_like_number);
+
+use lib dirname($0);
+use BackRest::Common::Log;
+use BackRest::BackupCommon;
+use BackRest::Config;
+use BackRest::File;
+use BackRest::Manifest;
+
+####################################################################################################################################
+# Operation constants
+####################################################################################################################################
+use constant OP_EXPIRE => 'Expire';
+
+use constant OP_EXPIRE_NEW => OP_EXPIRE . '->new';
+use constant OP_EXPIRE_PROCESS => OP_EXPIRE . '->process';
+
+####################################################################################################################################
+# new
+####################################################################################################################################
+sub new
+{
+ my $class = shift;
+
+ # Create the class hash
+ my $self = {};
+ bless $self, $class;
+
+ # Assign function parameters, defaults, and log debug info
+ (
+ my $strOperation,
+ $self->{oFile}
+ ) =
+ logDebugParam
+ (
+ OP_EXPIRE_NEW, \@_,
+ {name => 'oFile'}
+ );
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'self', value => $self}
+ );
+}
+
+####################################################################################################################################
+# process
+#
+# Removes expired backups and archive logs from the backup directory. Partial backups are not counted for expiration, so if full
+# or differential retention is set to 2, there must be three complete backups before the oldest one can be deleted.
+####################################################################################################################################
+sub process
+{
+ my $self = shift;
+
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation
+ ) =
+ logDebugParam
+ (
+ OP_EXPIRE_PROCESS
+ );
+
+ my $strPath;
+ my @stryPath;
+
+ my $oFile = $self->{oFile};
+ my $strBackupClusterPath = $oFile->pathGet(PATH_BACKUP_CLUSTER);
+ my $iFullRetention = optionGet(OPTION_RETENTION_FULL, false);
+ my $iDifferentialRetention = optionGet(OPTION_RETENTION_DIFF, false);
+ my $strArchiveRetentionType = optionGet(OPTION_RETENTION_ARCHIVE_TYPE, false);
+ my $iArchiveRetention = optionGet(OPTION_RETENTION_ARCHIVE, false);
+
+ # Load or build backup.info
+ my $oBackupInfo = new BackRest::BackupInfo($oFile->pathGet(PATH_BACKUP_CLUSTER));
+
+ # Find all the expired full backups
+ if (defined($iFullRetention))
+ {
+ # Make sure iFullRetention is valid
+ if (!looks_like_number($iFullRetention) || $iFullRetention < 1)
+ {
+ confess &log(ERROR, 'full_retention must be a number >= 1');
+ }
+
+ my $iIndex = $iFullRetention;
+ @stryPath = $oFile->list(PATH_BACKUP_CLUSTER, undef, backupRegExpGet(true), 'reverse');
+
+ while (defined($stryPath[$iIndex]))
+ {
+ # Delete all backups that depend on the full backup. Done in reverse order so that remaining backups will still
+ # be consistent if the process dies
+ foreach $strPath ($oFile->list(PATH_BACKUP_CLUSTER, undef, '^' . $stryPath[$iIndex] . '.*', 'reverse'))
+ {
+ system("rm -rf ${strBackupClusterPath}/${strPath}") == 0
+ or confess &log(ERROR, "unable to delete backup ${strPath}");
+
+ $oBackupInfo->delete($strPath);
+ }
+
+ &log(INFO, 'remove expired full backup: ' . $stryPath[$iIndex]);
+
+ $iIndex++;
+ }
+ }
+
+ # Find all the expired differential backups
+ if (defined($iDifferentialRetention))
+ {
+ # Make sure iDifferentialRetention is valid
+ if (!looks_like_number($iDifferentialRetention) || $iDifferentialRetention < 1)
+ {
+ confess &log(ERROR, 'differential_retention must be a number >= 1');
+ }
+
+ @stryPath = $oFile->list(PATH_BACKUP_CLUSTER, undef, backupRegExpGet(false, true), 'reverse');
+
+ if (defined($stryPath[$iDifferentialRetention - 1]))
+ {
+ logDebugMisc($strOperation, 'differential expiration based on ' . $stryPath[$iDifferentialRetention - 1]);
+
+ # Get a list of all differential and incremental backups
+ foreach $strPath ($oFile->list(PATH_BACKUP_CLUSTER, undef, backupRegExpGet(false, true, true), 'reverse'))
+ {
+ logDebugMisc($strOperation, "checking ${strPath} for differential expiration");
+
+ # Remove all differential and incremental backups before the oldest valid differential
+ if ($strPath lt $stryPath[$iDifferentialRetention - 1])
+ {
+ system("rm -rf ${strBackupClusterPath}/${strPath}") == 0
+ or confess &log(ERROR, "unable to delete backup ${strPath}");
+ $oBackupInfo->delete($strPath);
+
+ &log(INFO, "remove expired diff/incr backup ${strPath}");
+ }
+ }
+ }
+ }
+
+ # If no archive retention type is set then exit
+ if (!defined($strArchiveRetentionType))
+ {
+ &log(INFO, 'archive retention type not set - archive logs will not be expired');
+ }
+ else
+ {
+ # Determine which backup type to use for archive retention (full, differential, incremental)
+ if ($strArchiveRetentionType eq BACKUP_TYPE_FULL)
+ {
+ if (!defined($iArchiveRetention))
+ {
+ $iArchiveRetention = $iFullRetention;
+ }
+
+ @stryPath = $oFile->list(PATH_BACKUP_CLUSTER, undef, backupRegExpGet(true), 'reverse');
+ }
+ elsif ($strArchiveRetentionType eq BACKUP_TYPE_DIFF)
+ {
+ if (!defined($iArchiveRetention))
+ {
+ $iArchiveRetention = $iDifferentialRetention;
+ }
+
+ @stryPath = $oFile->list(PATH_BACKUP_CLUSTER, undef, backupRegExpGet(true, true), 'reverse');
+ }
+ elsif ($strArchiveRetentionType eq BACKUP_TYPE_INCR)
+ {
+ @stryPath = $oFile->list(PATH_BACKUP_CLUSTER, undef, backupRegExpGet(true, true, true), 'reverse');
+ }
+ else
+ {
+ confess &log(ERROR, "unknown archive_retention_type '$strArchiveRetentionType'");
+ }
+
+ # Make sure that iArchiveRetention is set and valid
+ if (!defined($iArchiveRetention))
+ {
+ confess &log(ERROR, 'archive_retention must be set if archive_retention_type is set');
+ }
+
+ if (!looks_like_number($iArchiveRetention) || $iArchiveRetention < 1)
+ {
+ confess &log(ERROR, 'archive_retention must be a number >= 1');
+ }
+
+ # if no backups were found then preserve current archive logs - too scary to delete them!
+ my $iBackupTotal = scalar @stryPath;
+
+ if ($iBackupTotal > 0)
+ {
+ # See if enough backups exist for expiration to start
+ my $strArchiveRetentionBackup = $stryPath[$iArchiveRetention - 1];
+
+ if (!defined($strArchiveRetentionBackup))
+ {
+ if ($strArchiveRetentionType eq BACKUP_TYPE_FULL && scalar @stryPath > 0)
+ {
+ &log(INFO, 'fewer than required backups for retention, ' .
+ 'but since archive_retention_type = full using oldest full backup');
+ $strArchiveRetentionBackup = $stryPath[scalar @stryPath - 1];
+ }
+ }
+
+ if (defined($strArchiveRetentionBackup))
+ {
+ # Get the archive logs that need to be kept. To be cautious we will keep all the archive logs starting from this
+ # backup even though they are also in the pg_xlog directory (since they have been copied more than once).
+ &log(INFO, 'archive retention based on backup ' . $strArchiveRetentionBackup);
+
+ my $oManifest = new BackRest::Manifest($oFile->pathGet(PATH_BACKUP_CLUSTER) .
+ "/${strArchiveRetentionBackup}/backup.manifest");
+ my $strArchiveLast = $oManifest->get(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_ARCHIVE_START);
+
+ if (!defined($strArchiveLast))
+ {
+ confess &log(ERROR, "invalid archive location retrieved ${strArchiveRetentionBackup}");
+ }
+
+ &log(INFO, 'archive retention starts at ' . $strArchiveLast);
+
+ # Get archive info
+ my $oArchive = new BackRest::Archive();
+ my $strArchiveId = $oArchive->getCheck($oFile);
+
+ # Remove any archive directories or files that are out of date
+ foreach $strPath ($oFile->list(PATH_BACKUP_ARCHIVE, $strArchiveId, "^[0-F]{16}\$"))
+ {
+ logDebugMisc($strOperation, "found major archive path: ${strPath}");
+
+ # If less than first 16 characters of current archive file, then remove the directory
+ if ($strPath lt substr($strArchiveLast, 0, 16))
+ {
+ my $strFullPath = $oFile->pathGet(PATH_BACKUP_ARCHIVE, $strArchiveId) . "/${strPath}";
+
+ remove_tree($strFullPath) > 0 or confess &log(ERROR, "unable to remove ${strFullPath}");
+
+ logDebugMisc($strOperation, "remove major archive path: ${strFullPath}");
+ }
+ # If equals the first 16 characters of the current archive file, then delete individual files instead
+ elsif ($strPath eq substr($strArchiveLast, 0, 16))
+ {
+ my $strSubPath;
+
+ # Look for archive files in the archive directory
+ foreach $strSubPath ($oFile->list(PATH_BACKUP_ARCHIVE, "${strArchiveId}/${strPath}", "^[0-F]{24}.*\$"))
+ {
+ # Delete if the first 24 characters less than the current archive file
+ if ($strSubPath lt substr($strArchiveLast, 0, 24))
+ {
+ unlink($oFile->pathGet(PATH_BACKUP_ARCHIVE, "${strArchiveId}/${strSubPath}"))
+ or confess &log(ERROR, 'unable to remove ' . $strSubPath);
+
+ logDebugMisc($strOperation, "remove expired archive file: ${strSubPath}");
+ }
+ }
+ }
+ }
+ }
+ }
+ }
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation
+ );
+}
+
+1;
diff --git a/lib/BackRest/File.pm b/lib/BackRest/File.pm
index 359928bca..8694cea35 100644
--- a/lib/BackRest/File.pm
+++ b/lib/BackRest/File.pm
@@ -8,8 +8,9 @@ use warnings FATAL => qw(all);
use Carp qw(confess);
use Exporter qw(import);
+ our @EXPORT = qw();
use Digest::SHA;
-use Fcntl qw(:mode O_RDONLY O_WRONLY O_CREAT O_EXCL);
+use Fcntl qw(:mode :flock O_RDONLY O_WRONLY O_CREAT O_EXCL);
use File::Basename qw(dirname basename);
use File::Copy qw(cp);
use File::Path qw(make_path remove_tree);
@@ -18,118 +19,131 @@ use IO::Handle;
use Scalar::Util qw(blessed);
use lib dirname($0) . '/../lib';
+use BackRest::Common::Exception;
+use BackRest::Common::Log;
+use BackRest::Common::String;
+use BackRest::Common::Wait;
use BackRest::Config;
-use BackRest::Exception;
use BackRest::FileCommon;
-use BackRest::Utility;
-
-####################################################################################################################################
-# COMMAND Error Constants
-####################################################################################################################################
-use constant
-{
- COMMAND_ERR_FILE_MISSING => 1,
- COMMAND_ERR_FILE_READ => 2,
- COMMAND_ERR_FILE_MOVE => 3,
- COMMAND_ERR_FILE_TYPE => 4,
- COMMAND_ERR_LINK_READ => 5,
- COMMAND_ERR_PATH_MISSING => 6,
- COMMAND_ERR_PATH_CREATE => 7,
- COMMAND_ERR_PATH_READ => 8
-};
-
-our @EXPORT = qw(COMMAND_ERR_FILE_MISSING COMMAND_ERR_FILE_READ COMMAND_ERR_FILE_MOVE COMMAND_ERR_FILE_TYPE COMMAND_ERR_LINK_READ
- COMMAND_ERR_PATH_MISSING COMMAND_ERR_PATH_CREATE COMMAND_ERR_PARAM);
-
-####################################################################################################################################
-# PATH_GET Constants
-####################################################################################################################################
-use constant
-{
- PATH_ABSOLUTE => 'absolute',
- PATH_DB => 'db',
- PATH_DB_ABSOLUTE => 'db:absolute',
- PATH_BACKUP => 'backup',
- PATH_BACKUP_ABSOLUTE => 'backup:absolute',
- PATH_BACKUP_CLUSTER => 'backup:cluster',
- PATH_BACKUP_TMP => 'backup:tmp',
- PATH_BACKUP_ARCHIVE => 'backup:archive',
- PATH_BACKUP_ARCHIVE_OUT => 'backup:archive:out'
-};
-
-push @EXPORT, qw(PATH_ABSOLUTE PATH_DB PATH_DB_ABSOLUTE PATH_BACKUP PATH_BACKUP_ABSOLUTE PATH_BACKUP_CLUSTER PATH_BACKUP_TMP
- PATH_BACKUP_ARCHIVE PATH_BACKUP_ARCHIVE_OUT);
-
-####################################################################################################################################
-# STD Pipe Constants
-####################################################################################################################################
-use constant
-{
- PIPE_STDIN => '',
- PIPE_STDOUT => '',
- PIPE_STDERR => ''
-};
-
-push @EXPORT, qw(PIPE_STDIN PIPE_STDOUT PIPE_STDERR);
####################################################################################################################################
# Operation constants
####################################################################################################################################
-use constant
-{
- OP_FILE_OWNER => 'File->owner',
- OP_FILE_WAIT => 'File->wait',
- OP_FILE_LIST => 'File->list',
- OP_FILE_EXISTS => 'File->exists',
- OP_FILE_HASH => 'File->hash',
- OP_FILE_REMOVE => 'File->remove',
- OP_FILE_MANIFEST => 'File->manifest',
- OP_FILE_COMPRESS => 'File->compress',
- OP_FILE_MOVE => 'File->move',
- OP_FILE_COPY => 'File->copy',
- OP_FILE_COPY_OUT => 'File->copy_out',
- OP_FILE_COPY_IN => 'File->copy_in',
- OP_FILE_PATH_CREATE => 'File->path_create',
- OP_FILE_PATH_SYNC => 'File->pathSync',
- OP_FILE_PATH_SYNC_STATIC => 'File::filePathSync',
- OP_FILE_LINK_CREATE => 'File->link_create'
-};
+use constant OP_FILE => 'File';
-push @EXPORT, qw(OP_FILE_OWNER OP_FILE_WAIT OP_FILE_LIST OP_FILE_EXISTS OP_FILE_HASH OP_FILE_REMOVE OP_FILE_MANIFEST
- OP_FILE_COMPRESS OP_FILE_MOVE OP_FILE_COPY OP_FILE_COPY_OUT OP_FILE_COPY_IN OP_FILE_PATH_CREATE);
+use constant OP_FILE_CLONE => OP_FILE . '->clone';
+use constant OP_FILE_COMPRESS => OP_FILE . '->compress';
+use constant OP_FILE_COPY => OP_FILE . '->copy';
+ push @EXPORT, qw(OP_FILE_COPY);
+use constant OP_FILE_COPY_IN => OP_FILE . '->copyIn';
+ push @EXPORT, qw(OP_FILE_COPY_IN);
+use constant OP_FILE_COPY_OUT => OP_FILE . '->copyOut';
+ push @EXPORT, qw(OP_FILE_COPY_OUT);
+use constant OP_FILE_DESTROY => OP_FILE . '->DESTROY';
+use constant OP_FILE_EXISTS => OP_FILE . '->exists';
+ push @EXPORT, qw(OP_FILE_EXISTS);
+use constant OP_FILE_HASH => OP_FILE . '->hash';
+use constant OP_FILE_HASH_SIZE => OP_FILE . '->hashSize';
+use constant OP_FILE_LINK_CREATE => OP_FILE . '->linkCreate';
+use constant OP_FILE_LIST => OP_FILE . '->list';
+ push @EXPORT, qw(OP_FILE_LIST);
+use constant OP_FILE_MANIFEST => OP_FILE . '->manifest';
+ push @EXPORT, qw(OP_FILE_MANIFEST);
+use constant OP_FILE_MANIFEST_RECURSE => OP_FILE . '->manifestRecurse';
+use constant OP_FILE_MOVE => OP_FILE . '->move';
+use constant OP_FILE_NEW => OP_FILE . '->new';
+use constant OP_FILE_OWNER => OP_FILE . '->owner';
+use constant OP_FILE_PATH_CREATE => OP_FILE . '->pathCreate';
+ push @EXPORT, qw(OP_FILE_PATH_CREATE);
+use constant OP_FILE_PATH_GET => OP_FILE . '->pathGet';
+use constant OP_FILE_PATH_SYNC => OP_FILE . '->pathSync';
+use constant OP_FILE_PATH_SYNC_STATIC => OP_FILE . '::filePathSync';
+use constant OP_FILE_REMOVE => OP_FILE . '->remove';
+use constant OP_FILE_STANZA => OP_FILE . '->stanza';
+use constant OP_FILE_WAIT => OP_FILE . '->wait';
+ push @EXPORT, qw(OP_FILE_WAIT);
####################################################################################################################################
-# CONSTRUCTOR
+# COMMAND error constants [DEPRECATED - TO BE REPLACED BY CONSTANTS IN EXCEPTION.PM]
+####################################################################################################################################
+use constant COMMAND_ERR_FILE_MISSING => 1;
+use constant COMMAND_ERR_FILE_READ => 2;
+use constant COMMAND_ERR_FILE_MOVE => 3;
+use constant COMMAND_ERR_FILE_TYPE => 4;
+use constant COMMAND_ERR_LINK_READ => 5;
+use constant COMMAND_ERR_PATH_MISSING => 6;
+use constant COMMAND_ERR_PATH_CREATE => 7;
+use constant COMMAND_ERR_PATH_READ => 8;
+
+####################################################################################################################################
+# PATH_GET constants
+####################################################################################################################################
+use constant PATH_ABSOLUTE => 'absolute';
+ push @EXPORT, qw(PATH_ABSOLUTE);
+use constant PATH_DB => 'db';
+ push @EXPORT, qw(PATH_DB);
+use constant PATH_DB_ABSOLUTE => 'db:absolute';
+ push @EXPORT, qw(PATH_DB_ABSOLUTE);
+use constant PATH_BACKUP => 'backup';
+ push @EXPORT, qw(PATH_BACKUP);
+use constant PATH_BACKUP_ABSOLUTE => 'backup:absolute';
+ push @EXPORT, qw(PATH_BACKUP_ABSOLUTE);
+use constant PATH_BACKUP_CLUSTER => 'backup:cluster';
+ push @EXPORT, qw(PATH_BACKUP_CLUSTER);
+use constant PATH_BACKUP_TMP => 'backup:tmp';
+ push @EXPORT, qw(PATH_BACKUP_TMP);
+use constant PATH_BACKUP_ARCHIVE => 'backup:archive';
+ push @EXPORT, qw(PATH_BACKUP_ARCHIVE);
+use constant PATH_BACKUP_ARCHIVE_OUT => 'backup:archive:out';
+ push @EXPORT, qw(PATH_BACKUP_ARCHIVE_OUT);
+
+####################################################################################################################################
+# STD pipe constants
+####################################################################################################################################
+use constant PIPE_STDIN => '';
+ push @EXPORT, qw(PIPE_STDIN);
+use constant PIPE_STDOUT => '';
+ push @EXPORT, qw(PIPE_STDOUT);
+use constant PIPE_STDERR => '';
+ push @EXPORT, qw(PIPE_STDERR);
+
+####################################################################################################################################
+# new
####################################################################################################################################
sub new
{
my $class = shift;
- my $strStanza = shift;
- my $strBackupPath = shift;
- my $strRemote = shift;
- my $oProtocol = shift;
- my $strDefaultPathMode = shift;
- my $strDefaultFileMode = shift;
- my $iThreadIdx = shift;
# Create the class hash
my $self = {};
bless $self, $class;
+ # Assign function parameters, defaults, and log debug info
+ (
+ my $strOperation,
+ $self->{strStanza},
+ $self->{strBackupPath},
+ $self->{strRemote},
+ $self->{oProtocol},
+ $self->{strDefaultPathMode},
+ $self->{strDefaultFileMode},
+ $self->{iThreadIdx}
+ ) =
+ logDebugParam
+ (
+ OP_FILE_NEW, \@_,
+ {name => 'strStanza', required => false},
+ {name => 'strBackupPath'},
+ {name => 'strRemote', required => false},
+ {name => 'oProtocol'},
+ {name => 'strDefaultPathMode', default => '0750'},
+ {name => 'strDefaultFileMode', default => '0640'},
+ {name => 'iThreadIdx', required => false}
+ );
+
# Default compression extension to gz
$self->{strCompressExtension} = 'gz';
- # Default file and path mode
- $self->{strDefaultPathMode} = defined($strDefaultPathMode) ? $strDefaultPathMode : '0750';
- $self->{strDefaultFileMode} = defined($strDefaultFileMode) ? $strDefaultFileMode : '0640';
-
- # Initialize other variables
- $self->{strStanza} = $strStanza;
- $self->{strBackupPath} = $strBackupPath;
- $self->{strRemote} = $strRemote;
- $self->{oProtocol} = $oProtocol;
- $self->{iThreadIdx} = $iThreadIdx;
-
# Remote object must be set
if (!defined($self->{oProtocol}))
{
@@ -147,39 +161,76 @@ sub new
}
}
- return $self;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'self', value => $self}
+ );
}
####################################################################################################################################
-# DESTRUCTOR
+# DESTROY
####################################################################################################################################
-sub DEMOLISH
+sub DESTROY
{
my $self = shift;
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation
+ ) =
+ logDebugParam
+ (
+ OP_FILE_DESTROY
+ );
+
if (defined($self->{oProtocol}))
{
$self->{oProtocol} = undef;
}
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation
+ );
}
####################################################################################################################################
-# CLONE
+# clone
####################################################################################################################################
sub clone
{
my $self = shift;
- my $iThreadIdx = shift;
- return BackRest::File->new
+ # Assign function parameters, defaults, and log debug info
+ my
(
- $self->{strStanza},
- $self->{strBackupPath},
- $self->{strRemote},
- $self->{oProtocol},
- $self->{strDefaultPathMode},
- $self->{strDefaultFileMode},
+ $strOperation,
$iThreadIdx
+ ) =
+ logDebugParam
+ (
+ OP_FILE_CLONE, \@_,
+ {name => 'iThreadidx', required => false}
+ );
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'self', value => BackRest::File->new
+ (
+ $self->{strStanza},
+ $self->{strBackupPath},
+ $self->{strRemote},
+ $self->{oProtocol},
+ $self->{strDefaultPathMode},
+ $self->{strDefaultFileMode},
+ $iThreadIdx
+ )}
);
}
@@ -190,46 +241,97 @@ sub stanza
{
my $self = shift;
- return $self->{strStanza};
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation
+ ) =
+ logDebugParam
+ (
+ OP_FILE_STANZA
+ );
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'strStanza', $self->{strStanza}, trace => true}
+ );
}
####################################################################################################################################
-# PATH_TYPE_GET
+# pathTypeGet
####################################################################################################################################
-sub path_type_get
+sub pathTypeGet
{
my $self = shift;
- my $strType = shift;
+
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strType
+ ) =
+ logDebugParam
+ (
+ OP_FILE_CLONE, \@_,
+ {name => 'strType', trace => true}
+ );
+
+ my $strPath;
# If absolute type
if ($strType eq PATH_ABSOLUTE)
{
- return PATH_ABSOLUTE;
+ $strPath = PATH_ABSOLUTE;
}
# If db type
elsif ($strType =~ /^db(\:.*){0,1}/)
{
- return PATH_DB;
+ $strPath = PATH_DB;
}
# Else if backup type
elsif ($strType =~ /^backup(\:.*){0,1}/)
{
- return PATH_BACKUP;
+ $strPath = PATH_BACKUP;
+ }
+ # Else error when path type not recognized
+ else
+ {
+ confess &log(ASSERT, "no known path types in '${strType}'");
}
- # Error when path type not recognized
- confess &log(ASSERT, "no known path types in '${strType}'");
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'strPath', value => $strPath, trace => true}
+ );
}
####################################################################################################################################
-# PATH_GET
+# pathGet
+# !!! Need ot tackle the return paths in this function
####################################################################################################################################
-sub path_get
+sub pathGet
{
my $self = shift;
- my $strType = shift; # Base type of the path to get (PATH_DB_ABSOLUTE, PATH_BACKUP_TMP, etc)
- my $strFile = shift; # File to append to the base path (can include a path as well)
- my $bTemp = shift; # Return the temp file for this path type - only some types have temp files
+
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strType, # Base type of the path to get (PATH_DB_ABSOLUTE, PATH_BACKUP_TMP, etc)
+ $strFile, # File to append to the base path (can include a path as well)
+ $bTemp # Return the temp file for this path type - only some types have temp files
+ ) =
+ logDebugParam
+ (
+ OP_FILE_PATH_GET, \@_,
+ {name => 'strType', trace => true},
+ {name => 'strFile', required => false, trace => true},
+ {name => 'bTemp', default => false, trace => true}
+ );
# Make sure that any absolute path starts with /, otherwise it will actually be relative
my $bAbsolute = $strType =~ /.*absolute.*/;
@@ -240,8 +342,6 @@ sub path_get
}
# Only allow temp files for PATH_BACKUP_ARCHIVE, PATH_BACKUP_ARCHIVE_OUT, PATH_BACKUP_TMP and any absolute path
- $bTemp = defined($bTemp) ? $bTemp : false;
-
if ($bTemp && !($strType eq PATH_BACKUP_ARCHIVE || $strType eq PATH_BACKUP_ARCHIVE_OUT || $strType eq PATH_BACKUP_TMP ||
$bAbsolute))
{
@@ -347,103 +447,126 @@ sub path_get
}
####################################################################################################################################
-# IS_REMOTE
+# isRemote
#
# Determine whether the path type is remote
####################################################################################################################################
-sub is_remote
+sub isRemote
{
my $self = shift;
- my $strPathType = shift;
- return defined($self->{strRemote}) && $self->path_type_get($strPathType) eq $self->{strRemote};
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strPathType
+ ) =
+ logDebugParam
+ (
+ OP_FILE_CLONE, \@_,
+ {name => 'strPathType', trace => true}
+ );
+
+ my $bRemote = defined($self->{strRemote}) && $self->pathTypeGet($strPathType) eq $self->{strRemote};
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'bRemote', value => $bRemote, trace => true}
+ );
}
####################################################################################################################################
-# LINK_CREATE
+# linkCreate
####################################################################################################################################
-sub link_create
+sub linkCreate
{
my $self = shift;
- my $strSourcePathType = shift;
- my $strSourceFile = shift;
- my $strDestinationPathType = shift;
- my $strDestinationFile = shift;
- my $bHard = shift;
- my $bRelative = shift;
- my $bPathCreate = shift;
- # if bHard is not defined default to false
- $bHard = defined($bHard) ? $bHard : false;
-
- # if bRelative is not defined or bHard is true, default to false
- $bRelative = !defined($bRelative) || $bHard ? false : $bRelative;
-
- # if bPathCreate is not defined, default to true
- $bPathCreate = defined($bPathCreate) ? $bPathCreate : true;
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strSourcePathType,
+ $strSourceFile,
+ $strDestinationPathType,
+ $strDestinationFile,
+ $bHard,
+ $bRelative,
+ $bPathCreate
+ ) =
+ logDebugParam
+ (
+ OP_FILE_LINK_CREATE, \@_,
+ {name => 'strSourcePathType'},
+ {name => 'strSourceFile'},
+ {name => 'strDestinationPathType'},
+ {name => 'strDestinationFile'},
+ {name => 'bHard', default => false},
+ {name => 'bRelative', default => false},
+ {name => 'bPathCreate', default => true}
+ );
# Source and destination path types must be the same (e.g. both PATH_DB or both PATH_BACKUP, etc.)
- if ($self->path_type_get($strSourcePathType) ne $self->path_type_get($strDestinationPathType))
+ if ($self->pathTypeGet($strSourcePathType) ne $self->pathTypeGet($strDestinationPathType))
{
confess &log(ASSERT, 'path types must be equal in link create');
}
# Generate source and destination files
- my $strSource = $self->path_get($strSourcePathType, $strSourceFile);
- my $strDestination = $self->path_get($strDestinationPathType, $strDestinationFile);
-
- # Set operation and debug strings
- my $strOperation = OP_FILE_LINK_CREATE;
-
- my $strDebug = "${strSourcePathType}" . (defined($strSource) ? ":${strSource}" : '') .
- " to ${strDestinationPathType}" . (defined($strDestination) ? ":${strDestination}" : '') .
- ', hard = ' . ($bHard ? 'true' : 'false') . ", relative = " . ($bRelative ? 'true' : 'false') .
- ', destination_path_create = ' . ($bPathCreate ? 'true' : 'false');
- &log(DEBUG, "${strOperation}: ${strDebug}");
-
- # If the destination path is backup and does not exist, create it
- # !!! This should only happen when the link create errors
- if ($bPathCreate && $self->path_type_get($strDestinationPathType) eq PATH_BACKUP)
- {
- $self->path_create(PATH_BACKUP_ABSOLUTE, dirname($strDestination));
- }
-
- unless (-e $strSource)
- {
- if (-e $strSource . ".$self->{strCompressExtension}")
- {
- $strSource .= ".$self->{strCompressExtension}";
- $strDestination .= ".$self->{strCompressExtension}";
- }
- else
- {
- # Error when a hardlink will be created on a missing file
- if ($bHard)
- {
- confess &log(ASSERT, "unable to find ${strSource}(.$self->{strCompressExtension}) for link");
- }
- }
- }
-
- # Generate relative path if requested
- if ($bRelative)
- {
- my $iCommonLen = common_prefix($strSource, $strDestination);
-
- if ($iCommonLen != 0)
- {
- $strSource = ('../' x substr($strDestination, $iCommonLen) =~ tr/\///) . substr($strSource, $iCommonLen);
- }
- }
+ my $strSource = $self->pathGet($strSourcePathType, $strSourceFile);
+ my $strDestination = $self->pathGet($strDestinationPathType, $strDestinationFile);
# Run remotely
- if ($self->is_remote($strSourcePathType))
+ if ($self->isRemote($strSourcePathType))
{
- confess &log(ASSERT, "${strDebug}: remote operation not supported");
+ confess &log(ASSERT, 'remote operation not supported');
}
# Run locally
else
{
+ # If the destination path is backup and does not exist, create it
+ # !!! This should only happen when the link create errors
+ if ($bPathCreate && $self->pathTypeGet($strDestinationPathType) eq PATH_BACKUP)
+ {
+ $self->pathCreate(PATH_BACKUP_ABSOLUTE, dirname($strDestination));
+ }
+
+ unless (-e $strSource)
+ {
+ if (-e $strSource . ".$self->{strCompressExtension}")
+ {
+ $strSource .= ".$self->{strCompressExtension}";
+ $strDestination .= ".$self->{strCompressExtension}";
+ }
+ else
+ {
+ # Error when a hardlink will be created on a missing file
+ if ($bHard)
+ {
+ confess &log(ASSERT, "unable to find ${strSource}(.$self->{strCompressExtension}) for link");
+ }
+ }
+ }
+
+ # Generate relative path if requested
+ if ($bRelative)
+ {
+ my $iCommonLen = commonPrefix($strSource, $strDestination);
+
+ if ($iCommonLen != 0)
+ {
+ $strSource = ('../' x substr($strDestination, $iCommonLen) =~ tr/\///) . substr($strSource, $iCommonLen);
+ }
+
+ logDebugMisc
+ (
+ $strOperation, 'apply relative path',
+ {name => 'strSource', value => $strSource, trace => true}
+ );
+ }
+
if ($bHard)
{
link($strSource, $strDestination)
@@ -455,6 +578,12 @@ sub link_create
or confess &log(ERROR, "unable to create symlink from ${strSource} to ${strDestination}");
}
}
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation
+ );
}
####################################################################################################################################
@@ -465,53 +594,73 @@ sub link_create
sub pathSync
{
my $self = shift;
- my $strPathType = shift;
- my $strPath = shift;
- logTrace(OP_FILE_PATH_SYNC, DEBUG_CALL, undef, {pathType => \$strPathType, path => \$strPath});
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strPathType,
+ $strPath,
+ ) =
+ logDebugParam
+ (
+ OP_FILE_PATH_SYNC, \@_,
+ {name => 'strPathType', trace => true},
+ {name => 'strPath', trace => true}
+ );
- filePathSync($self->path_get($strPathType, $strPath eq '.' ? undef : $strPath));
+ filePathSync($self->pathGet($strPathType, $strPath eq '.' ? undef : $strPath));
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation
+ );
}
####################################################################################################################################
-# MOVE
+# move
#
# Moves a file locally or remotely.
####################################################################################################################################
sub move
{
my $self = shift;
- my $strSourcePathType = shift;
- my $strSourceFile = shift;
- my $strDestinationPathType = shift;
- my $strDestinationFile = shift;
- my $bDestinationPathCreate = shift;
- # Set defaults
- $bDestinationPathCreate = defined($bDestinationPathCreate) ? $bDestinationPathCreate : false;
-
- # Set operation variables
- my $strPathOpSource = $self->path_get($strSourcePathType, $strSourceFile);
- my $strPathOpDestination = $self->path_get($strDestinationPathType, $strDestinationFile);
-
- # Set operation and debug strings
- my $strOperation = OP_FILE_MOVE;
-
- my $strDebug = "${strSourcePathType}" . (defined($strSourceFile) ? ":${strSourceFile}" : '') .
- " to ${strDestinationPathType}" . (defined($strDestinationFile) ? ":${strDestinationFile}" : '') .
- ', destination_path_create = ' . ($bDestinationPathCreate ? 'true' : 'false');
- &log(DEBUG, "${strOperation}: ${strDebug}");
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strSourcePathType,
+ $strSourceFile,
+ $strDestinationPathType,
+ $strDestinationFile,
+ $bDestinationPathCreate
+ ) =
+ logDebugParam
+ (
+ OP_FILE_MOVE, \@_,
+ {name => 'strSourcePathType'},
+ {name => 'strSourceFile', required => false},
+ {name => 'strDestinationPathType'},
+ {name => 'strDestinationFile'},
+ {name => 'bDestinationPathCreate', default => false}
+ );
# Source and destination path types must be the same
- if ($self->path_type_get($strSourcePathType) ne $self->path_type_get($strSourcePathType))
+ if ($self->pathTypeGet($strSourcePathType) ne $self->pathTypeGet($strSourcePathType))
{
- confess &log(ASSERT, "${strDebug}: source and destination path types must be equal");
+ confess &log(ASSERT, 'source and destination path types must be equal');
}
+ # Set operation variables
+ my $strPathOpSource = $self->pathGet($strSourcePathType, $strSourceFile);
+ my $strPathOpDestination = $self->pathGet($strDestinationPathType, $strDestinationFile);
+
# Run remotely
- if ($self->is_remote($strSourcePathType))
+ if ($self->isRemote($strSourcePathType))
{
- confess &log(ASSERT, "${strDebug}: remote operation not supported");
+ confess &log(ASSERT, 'remote operation not supported');
}
# Run locally
else
@@ -520,7 +669,7 @@ sub move
{
if ($bDestinationPathCreate)
{
- $self->path_create(PATH_ABSOLUTE, dirname($strPathOpDestination), undef, true);
+ $self->pathCreate(PATH_ABSOLUTE, dirname($strPathOpDestination), undef, true);
}
if (!$bDestinationPathCreate || !rename($strPathOpSource, $strPathOpDestination))
@@ -541,37 +690,49 @@ sub move
confess &log(ERROR, $strError, $iErrorCode);
}
- confess &log(ERROR, "${strDebug}: " . $strError);
+ confess &log(ERROR, $strError);
}
}
}
$self->pathSync($strDestinationPathType, dirname($strDestinationFile));
}
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation
+ );
}
####################################################################################################################################
-# COMPRESS
+# compress
####################################################################################################################################
sub compress
{
my $self = shift;
- my $strPathType = shift;
- my $strFile = shift;
+
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strPathType,
+ $strFile
+ ) =
+ logDebugParam
+ (
+ OP_FILE_COMPRESS, \@_,
+ {name => 'strPathType'},
+ {name => 'strFile'}
+ );
# Set operation variables
- my $strPathOp = $self->path_get($strPathType, $strFile);
-
- # Set operation and debug strings
- my $strOperation = OP_FILE_COMPRESS;
-
- my $strDebug = "${strPathType}:${strPathOp}";
- &log(DEBUG, "${strOperation}: ${strDebug}");
+ my $strPathOp = $self->pathGet($strPathType, $strFile);
# Run remotely
- if ($self->is_remote($strPathType))
+ if ($self->isRemote($strPathType))
{
- confess &log(ASSERT, "${strDebug}: remote operation not supported");
+ confess &log(ASSERT, 'remote operation not supported');
}
# Run locally
else
@@ -581,33 +742,47 @@ sub compress
# Remove the old file
unlink($strPathOp)
- or die &log(ERROR, "${strDebug}: unable to remove ${strPathOp}");
+ or die &log(ERROR, "unable to remove ${strPathOp}");
}
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation
+ );
}
####################################################################################################################################
-# PATH_CREATE
+# pathCreate
#
# Creates a path locally or remotely.
####################################################################################################################################
-sub path_create
+sub pathCreate
{
my $self = shift;
- my $strPathType = shift;
- my $strPath = shift;
- my $strMode = shift;
- my $bIgnoreExists = shift;
+
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strPathType,
+ $strPath,
+ $strMode,
+ $bIgnoreExists
+ ) =
+ logDebugParam
+ (
+ OP_FILE_PATH_CREATE, \@_,
+ {name => 'strPathType'},
+ {name => 'strPath', required => false},
+ {name => 'strMode', default => '0750'},
+ {name => 'bIgnoreExists', default => false}
+ );
# Set operation variables
- my $strPathOp = $self->path_get($strPathType, $strPath);
- $strMode = defined($strMode) ? $strMode : '0750';
+ my $strPathOp = $self->pathGet($strPathType, $strPath);
- # Set operation and debug strings
- my $strOperation = OP_FILE_PATH_CREATE;
- my $strDebug = "${strPathType}:${strPathOp}, mode ${strMode}";
- &log(DEBUG, "${strOperation}: ${strDebug}");
-
- if ($self->is_remote($strPathType))
+ if ($self->isRemote($strPathType))
{
# Build param hash
my %oParamHash;
@@ -619,13 +794,8 @@ sub path_create
$oParamHash{mode} = ${strMode};
}
- # Add remote info to debug string
- my $strRemote = 'remote (' . $self->{oProtocol}->commandParamString(\%oParamHash) . ')';
- $strDebug = "${strOperation}: ${strRemote}: ${strDebug}";
- &log(TRACE, "${strOperation}: ${strRemote}");
-
# Execute the command
- $self->{oProtocol}->cmdExecute($strOperation, \%oParamHash, false, $strDebug);
+ $self->{oProtocol}->cmdExecute(OP_FILE_PATH_CREATE, \%oParamHash, false);
}
else
{
@@ -655,46 +825,57 @@ sub path_create
}
# Error the normal way
- confess &log(ERROR, "${strDebug}: " . $strError); #, COMMAND_ERR_PATH_CREATE);
+ confess &log(ERROR, $strError); #, COMMAND_ERR_PATH_CREATE);
}
}
}
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation
+ );
}
####################################################################################################################################
-# EXISTS - Checks for the existence of a file, but does not imply that the file is readable/writeable.
+# exists
+#
+# Checks for the existence of a file, but does not imply that the file is readable/writeable.
#
# Return: true if file exists, false otherwise
####################################################################################################################################
sub exists
{
my $self = shift;
- my $strPathType = shift;
- my $strPath = shift;
+
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strPathType,
+ $strPath
+ ) =
+ logDebugParam
+ (
+ OP_FILE_EXISTS, \@_,
+ {name => 'strPathType'},
+ {name => 'strPath', required => false}
+ );
# Set operation variables
- my $strPathOp = $self->path_get($strPathType, $strPath);
-
- # Set operation and debug strings
- my $strOperation = OP_FILE_EXISTS;
- my $strDebug = "${strPathType}:${strPathOp}";
- &log(DEBUG, "${strOperation}: ${strDebug}");
+ my $strPathOp = $self->pathGet($strPathType, $strPath);
+ my $bExists = true;
# Run remotely
- if ($self->is_remote($strPathType))
+ if ($self->isRemote($strPathType))
{
# Build param hash
my %oParamHash;
$oParamHash{path} = $strPathOp;
- # Add remote info to debug string
- my $strRemote = 'remote (' . $self->{oProtocol}->commandParamString(\%oParamHash) . ')';
- $strDebug = "${strOperation}: ${strRemote}: ${strDebug}";
- &log(TRACE, "${strOperation}: ${strRemote}");
-
# Execute the command
- return $self->{oProtocol}->cmdExecute($strOperation, \%oParamHash, true, $strDebug) eq 'Y';
+ $bExists = $self->{oProtocol}->cmdExecute($strOperation, \%oParamHash, true) eq 'Y' ? true : false;
}
# Run locally
else
@@ -714,44 +895,55 @@ sub exists
}
else
{
- confess &log(ERROR, "${strDebug}: " . $!); #, COMMAND_ERR_FILE_READ);
+ confess &log(ERROR, $!); #, COMMAND_ERR_FILE_READ);
}
}
- return false;
+ $bExists = false;
}
}
- return true;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'bExists', value => $bExists}
+ );
}
####################################################################################################################################
-# REMOVE
+# remove
####################################################################################################################################
sub remove
{
my $self = shift;
- my $strPathType = shift;
- my $strPath = shift;
- my $bTemp = shift;
- my $bIgnoreMissing = shift;
- # Set defaults
- $bIgnoreMissing = defined($bIgnoreMissing) ? $bIgnoreMissing : true;
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strPathType,
+ $strPath,
+ $bTemp,
+ $bIgnoreMissing
+ ) =
+ logDebugParam
+ (
+ OP_FILE_REMOVE, \@_,
+ {name => 'strPathType'},
+ {name => 'strPath'},
+ {name => 'bTemp', required => false},
+ {name => 'bIgnoreMissing', default => true}
+ );
# Set operation variables
- my $strPathOp = $self->path_get($strPathType, $strPath, $bTemp);
+ my $strPathOp = $self->pathGet($strPathType, $strPath, $bTemp);
my $bRemoved = true;
- # Set operation and debug strings
- my $strOperation = OP_FILE_REMOVE;
- my $strDebug = "${strPathType}:${strPathOp}";
- &log(DEBUG, "${strOperation}: ${strDebug}");
-
# Run remotely
- if ($self->is_remote($strPathType))
+ if ($self->isRemote($strPathType))
{
- confess &log(ASSERT, "${strDebug}: remote operation not supported");
+ confess &log(ASSERT, OP_FILE_REMOVE . ": remote operation not supported");
}
# Run locally
else
@@ -776,60 +968,87 @@ sub remove
confess &log(ERROR, $strError, $iErrorCode);
}
- confess &log(ERROR, "${strDebug}: " . $strError);
+ confess &log(ERROR, $strError);
}
}
}
- return $bRemoved;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'bRemoved', value => $bRemoved}
+ );
}
####################################################################################################################################
-# HASH
+# hash
####################################################################################################################################
sub hash
{
my $self = shift;
- my $strPathType = shift;
- my $strFile = shift;
- my $bCompressed = shift;
- my $strHashType = shift;
- my ($strHash, $iSize) = $self->hash_size($strPathType, $strFile, $bCompressed, $strHashType);
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strPathType,
+ $strFile,
+ $bCompressed,
+ $strHashType
+ ) =
+ logDebugParam
+ (
+ OP_FILE_HASH, \@_,
+ {name => 'strPathType'},
+ {name => 'strFile'},
+ {name => 'bCompressed', required => false},
+ {name => 'strHashType', required => false}
+ );
- return $strHash;
+ my ($strHash) = $self->hashSize($strPathType, $strFile, $bCompressed, $strHashType);
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'strHash', value => $strHash, trace => true}
+ );
}
####################################################################################################################################
-# HASH_SIZE
+# hashSize
####################################################################################################################################
-sub hash_size
+sub hashSize
{
my $self = shift;
- my $strPathType = shift;
- my $strFile = shift;
- my $bCompressed = shift;
- my $strHashType = shift;
- # Set defaults
- $bCompressed = defined($bCompressed) ? $bCompressed : false;
- $strHashType = defined($strHashType) ? $strHashType : 'sha1';
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strPathType,
+ $strFile,
+ $bCompressed,
+ $strHashType
+ ) =
+ logDebugParam
+ (
+ OP_FILE_HASH_SIZE, \@_,
+ {name => 'strPathType'},
+ {name => 'strFile'},
+ {name => 'bCompressed', default => false},
+ {name => 'strHashType', default => 'sha1'}
+ );
# Set operation variables
- my $strFileOp = $self->path_get($strPathType, $strFile);
+ my $strFileOp = $self->pathGet($strPathType, $strFile);
my $strHash;
my $iSize = 0;
- # Set operation and debug strings
- my $strOperation = OP_FILE_HASH;
- my $strDebug = "${strPathType}:${strFileOp}, " .
- 'compressed = ' . ($bCompressed ? 'true' : 'false') . ', ' .
- "hash_type = ${strHashType}";
- &log(DEBUG, "${strOperation}: ${strDebug}");
-
- if ($self->is_remote($strPathType))
+ if ($self->isRemote($strPathType))
{
- confess &log(ASSERT, "${strDebug}: remote operation not supported");
+ confess &log(ASSERT, OP_FILE_HASH_SIZE . ": remote operation not supported");
}
else
{
@@ -851,7 +1070,7 @@ sub hash_size
confess &log(ERROR, $strError, $iErrorCode);
}
- confess &log(ERROR, "${strDebug}: " . $strError);
+ confess &log(ERROR, $strError);
}
my $oSHA = Digest::SHA->new($strHashType);
@@ -887,33 +1106,46 @@ sub hash_size
close($hFile);
}
- return $strHash, $iSize;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'strHash', value => $strHash},
+ {name => 'iSize', value => $iSize}
+ );
}
####################################################################################################################################
-# OWNER
+# owner
####################################################################################################################################
sub owner
{
my $self = shift;
- my $strPathType = shift;
- my $strFile = shift;
- my $strUser = shift;
- my $strGroup = shift;
+
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strPathType,
+ $strFile,
+ $strUser,
+ $strGroup
+ ) =
+ logDebugParam
+ (
+ OP_FILE_OWNER, \@_,
+ {name => 'strPathType'},
+ {name => 'strFile'},
+ {name => 'strUser'},
+ {name => 'strGroup'}
+ );
# Set operation variables
- my $strFileOp = $self->path_get($strPathType, $strFile);
+ my $strFileOp = $self->pathGet($strPathType, $strFile);
- # Set operation and debug strings
- my $strOperation = OP_FILE_OWNER;
- my $strDebug = "${strPathType}:${strFileOp}, " .
- 'user = ' . (defined($strUser) ? $strUser : '[undef]') .
- ', group = ' . (defined($strGroup) ? $strGroup : '[undef]');
- &log(DEBUG, "${strOperation}: ${strDebug}");
-
- if ($self->is_remote($strPathType))
+ if ($self->isRemote($strPathType))
{
- confess &log(ASSERT, "${strDebug}: remote operation not supported");
+ confess &log(ASSERT, OP_FILE_OWNER . ": remote operation not supported");
}
else
{
@@ -952,37 +1184,47 @@ sub owner
chown($iUserId, $iGroupId, $strFileOp)
or confess &log(ERROR, "unable to set ownership for ${strFileOp}");
}
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation
+ );
}
####################################################################################################################################
-# LIST
+# list
####################################################################################################################################
sub list
{
my $self = shift;
- my $strPathType = shift;
- my $strPath = shift;
- my $strExpression = shift;
- my $strSortOrder = shift;
- my $bIgnoreMissing = shift;
- # Set defaults
- $strSortOrder = defined($strSortOrder) ? $strSortOrder : 'forward';
- $bIgnoreMissing = defined($bIgnoreMissing) ? $bIgnoreMissing : false;
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strPathType,
+ $strPath,
+ $strExpression,
+ $strSortOrder,
+ $bIgnoreMissing
+ ) =
+ logDebugParam
+ (
+ OP_FILE_LIST, \@_,
+ {name => 'strPathType'},
+ {name => 'strPath', required => false},
+ {name => 'strExpression', required => false},
+ {name => 'strSortOrder', default => 'forward'},
+ {name => 'bIgnoreMissing', default => false}
+ );
# Set operation variables
- my $strPathOp = $self->path_get($strPathType, $strPath);
+ my $strPathOp = $self->pathGet($strPathType, $strPath);
my @stryFileList;
- # Get the root path for the file list
- my $strOperation = OP_FILE_LIST;
- my $strDebug = "${strPathType}:${strPathOp}" .
- ', expression ' . (defined($strExpression) ? $strExpression : '[UNDEF]') .
- ", sort ${strSortOrder}";
- &log(DEBUG, "${strOperation}: ${strDebug}");
-
# Run remotely
- if ($self->is_remote($strPathType))
+ if ($self->isRemote($strPathType))
{
# Build param hash
my %oParamHash;
@@ -996,13 +1238,8 @@ sub list
$oParamHash{expression} = $strExpression;
}
- # Add remote info to debug string
- my $strRemote = 'remote (' . $self->{oProtocol}->commandParamString(\%oParamHash) . ')';
- $strDebug = "${strOperation}: ${strRemote}: ${strDebug}";
- &log(TRACE, "${strOperation}: ${strRemote}");
-
# Execute the command
- my $strOutput = $self->{oProtocol}->cmdExecute($strOperation, \%oParamHash, false, $strDebug);
+ my $strOutput = $self->{oProtocol}->cmdExecute(OP_FILE_LIST, \%oParamHash, false);
if (defined($strOutput))
{
@@ -1036,7 +1273,7 @@ sub list
confess &log(ERROR, $strError, $iErrorCode);
}
- confess &log(ERROR, "${strDebug}: " . $strError);
+ confess &log(ERROR, $strError);
}
@stryFileList = grep(!/^(\.)|(\.\.)$/i, readdir($hPath));
@@ -1060,12 +1297,16 @@ sub list
}
}
- # Return file list
- return @stryFileList;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'stryFileList', value => \@stryFileList}
+ );
}
####################################################################################################################################
-# WAIT
+# wait
#
# Wait until the next second. This is done in the file object because it must be performed on whichever side the db is on, local or
# remote. This function is used to make sure that no files are copied in the same second as the manifest is created. The reason is
@@ -1075,38 +1316,45 @@ sub list
sub wait
{
my $self = shift;
- my $strPathType = shift;
- # Set operation and debug strings
- my $strOperation = OP_FILE_WAIT;
- my $strDebug = "${strPathType}";
- &log(DEBUG, "${strOperation}: ${strDebug}");
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strPathType
+ ) =
+ logDebugParam
+ (
+ OP_FILE_WAIT, \@_,
+ {name => 'strPathType'}
+ );
# Second when the function was called
my $lTimeBegin;
# Run remotely
- if ($self->is_remote($strPathType))
+ if ($self->isRemote($strPathType))
{
- # Add remote info to debug string
- $strDebug = "${strOperation}: remote: ${strDebug}";
- &log(TRACE, "${strOperation}: remote");
-
# Execute the command
- $lTimeBegin = $self->{oProtocol}->cmdExecute($strOperation, undef, true, $strDebug);
+ $lTimeBegin = $self->{oProtocol}->cmdExecute(OP_FILE_WAIT, undef, true);
}
# Run locally
else
{
# Wait the remainder of the current second
- $lTimeBegin = wait_remainder();
+ $lTimeBegin = waitRemainder();
}
- return $lTimeBegin;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'lTimeBegin', value => $lTimeBegin, trace => true}
+ );
}
####################################################################################################################################
-# MANIFEST
+# manifest
#
# Builds a path/file manifest starting with the base path and including all subpaths. The manifest contains all the information
# needed to perform a backup or a delta with a previous backup.
@@ -1114,53 +1362,75 @@ sub wait
sub manifest
{
my $self = shift;
- my $strPathType = shift;
- my $strPath = shift;
- my $oManifestHashRef = shift;
+
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strPathType,
+ $strPath,
+ $oManifestHashRef
+ ) =
+ logDebugParam
+ (
+ OP_FILE_MANIFEST, \@_,
+ {name => 'strPathType'},
+ {name => 'strPath', required => false},
+ {name => 'oManifestHashRef'}
+ );
# Set operation variables
- my $strPathOp = $self->path_get($strPathType, $strPath);
-
- # Set operation and debug strings
- my $strOperation = OP_FILE_MANIFEST;
- my $strDebug = "${strPathType}:${strPathOp}";
- &log(DEBUG, "${strOperation}: ${strDebug}");
+ my $strPathOp = $self->pathGet($strPathType, $strPath);
# Run remotely
- if ($self->is_remote($strPathType))
+ if ($self->isRemote($strPathType))
{
# Build param hash
my %oParamHash;
$oParamHash{path} = $strPathOp;
- # Add remote info to debug string
- my $strRemote = 'remote (' . $self->{oProtocol}->commandParamString(\%oParamHash) . ')';
- $strDebug = "${strOperation}: ${strRemote}: ${strDebug}";
- &log(TRACE, "${strOperation}: ${strRemote}");
-
# Execute the command
- data_hash_build($oManifestHashRef, $self->{oProtocol}->cmdExecute($strOperation, \%oParamHash, true, $strDebug), "\t");
+ dataHashBuild($oManifestHashRef, $self->{oProtocol}->cmdExecute(OP_FILE_MANIFEST, \%oParamHash, true), "\t");
}
# Run locally
else
{
- $self->manifest_recurse($strPathType, $strPathOp, undef, 0, $oManifestHashRef, $strDebug);
+ $self->manifestRecurse($strPathType, $strPathOp, undef, 0, $oManifestHashRef);
}
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation
+ );
}
-sub manifest_recurse
+sub manifestRecurse
{
my $self = shift;
- my $strPathType = shift;
- my $strPathOp = shift;
- my $strPathFileOp = shift;
- my $iDepth = shift;
- my $oManifestHashRef = shift;
- my $strDebug = shift;
+
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strPathType,
+ $strPathOp,
+ $strPathFileOp,
+ $iDepth,
+ $oManifestHashRef
+ ) =
+ logDebugParam
+ (
+ OP_FILE_MANIFEST_RECURSE, \@_,
+ {name => 'strPathType'},
+ {name => 'strPathOp'},
+ {name => 'strPathFileOp', required => false},
+ {name => 'iDepth'},
+ {name => 'oManifestHashRef', required => false}
+ );
# Set operation and debug strings
- $strDebug = $strDebug . (defined($strPathFileOp) ? " => ${strPathFileOp}" : '');
my $strPathRead = $strPathOp . (defined($strPathFileOp) ? "/${strPathFileOp}" : '');
my $hPath;
@@ -1188,7 +1458,7 @@ sub manifest_recurse
confess &log(ERROR, $strError, $iErrorCode);
}
- confess &log(ERROR, "${strDebug}: " . $strError);
+ confess &log(ERROR, $strError);
}
# Get a list of all files in the path (except ..)
@@ -1197,7 +1467,7 @@ sub manifest_recurse
close($hPath);
# Loop through all subpaths/files in the path
- foreach my $strFile (@stryFileList)
+ foreach my $strFile (sort(@stryFileList))
{
my $strPathFile = "${strPathRead}/$strFile";
my $bCurrentDir = $strFile eq '.';
@@ -1237,7 +1507,7 @@ sub manifest_recurse
confess &log(ERROR, $strError, $iErrorCode);
}
- confess &log(ERROR, "${strDebug}: " . $strError);
+ confess &log(ERROR, $strError);
}
# Check for regular file
@@ -1279,7 +1549,7 @@ sub manifest_recurse
exit COMMAND_ERR_LINK_READ;
}
- confess &log(ERROR, "${strDebug}: " . $strError);
+ confess &log(ERROR, $strError);
}
}
}
@@ -1294,7 +1564,7 @@ sub manifest_recurse
exit COMMAND_ERR_FILE_TYPE;
}
- confess &log(ERROR, "${strDebug}: " . $strError);
+ confess &log(ERROR, $strError);
}
# Get user name
@@ -1312,13 +1582,19 @@ sub manifest_recurse
# Recurse into directories
if (${$oManifestHashRef}{name}{"${strFile}"}{type} eq 'd' && !$bCurrentDir)
{
- $self->manifest_recurse($strPathType, $strPathOp, $strFile, $iDepth + 1, $oManifestHashRef, $strDebug);
+ $self->manifestRecurse($strPathType, $strPathOp, $strFile, $iDepth + 1, $oManifestHashRef);
}
}
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation
+ );
}
####################################################################################################################################
-# COPY
+# copy
#
# Copies a file from one location to another:
#
@@ -1331,58 +1607,58 @@ sub manifest_recurse
sub copy
{
my $self = shift;
- my $strSourcePathType = shift;
- my $strSourceFile = shift;
- my $strDestinationPathType = shift;
- my $strDestinationFile = shift;
- my $bSourceCompressed = shift;
- my $bDestinationCompress = shift;
- my $bIgnoreMissingSource = shift;
- my $lModificationTime = shift;
- my $strMode = shift;
- my $bDestinationPathCreate = shift;
- my $strUser = shift;
- my $strGroup = shift;
- my $bAppendChecksum = shift;
- # Set defaults
- $bSourceCompressed = defined($bSourceCompressed) ? $bSourceCompressed : false;
- $bDestinationCompress = defined($bDestinationCompress) ? $bDestinationCompress : false;
- $bIgnoreMissingSource = defined($bIgnoreMissingSource) ? $bIgnoreMissingSource : false;
- $bDestinationPathCreate = defined($bDestinationPathCreate) ? $bDestinationPathCreate : false;
- $bAppendChecksum = defined($bAppendChecksum) ? $bAppendChecksum : false;
- $strMode = defined($strMode) ? $strMode : '0640';
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strSourcePathType,
+ $strSourceFile,
+ $strDestinationPathType,
+ $strDestinationFile,
+ $bSourceCompressed,
+ $bDestinationCompress,
+ $bIgnoreMissingSource,
+ $lModificationTime,
+ $strMode,
+ $bDestinationPathCreate,
+ $strUser,
+ $strGroup,
+ $bAppendChecksum
+ ) =
+ logDebugParam
+ (
+ OP_FILE_COPY, \@_,
+ {name => 'strSourcePathType'},
+ {name => 'strSourceFile', required => false},
+ {name => 'strDestinationPathType'},
+ {name => 'strDestinationFile', required => false},
+ {name => 'bSourceCompressed', default => false},
+ {name => 'bDestinationCompress', default => false},
+ {name => 'bIgnoreMissingSource', default => false},
+ {name => 'lModificationTime', required => false},
+ {name => 'strMode', default => '0640'},
+ {name => 'bDestinationPathCreate', default => false},
+ {name => 'strUser', required => false},
+ {name => 'strGroup', required => false},
+ {name => 'bAppendChecksum', default => false}
+ );
# Set working variables
- my $bSourceRemote = $self->is_remote($strSourcePathType) || $strSourcePathType eq PIPE_STDIN;
- my $bDestinationRemote = $self->is_remote($strDestinationPathType) || $strDestinationPathType eq PIPE_STDOUT;
+ my $bSourceRemote = $self->isRemote($strSourcePathType) || $strSourcePathType eq PIPE_STDIN;
+ my $bDestinationRemote = $self->isRemote($strDestinationPathType) || $strDestinationPathType eq PIPE_STDOUT;
my $strSourceOp = $strSourcePathType eq PIPE_STDIN ?
- $strSourcePathType : $self->path_get($strSourcePathType, $strSourceFile);
+ $strSourcePathType : $self->pathGet($strSourcePathType, $strSourceFile);
my $strDestinationOp = $strDestinationPathType eq PIPE_STDOUT ?
- $strDestinationPathType : $self->path_get($strDestinationPathType, $strDestinationFile);
+ $strDestinationPathType : $self->pathGet($strDestinationPathType, $strDestinationFile);
my $strDestinationTmpOp = $strDestinationPathType eq PIPE_STDOUT ?
- undef : $self->path_get($strDestinationPathType, $strDestinationFile, true);
+ undef : $self->pathGet($strDestinationPathType, $strDestinationFile, true);
# Checksum and size variables
my $strChecksum = undef;
my $iFileSize = undef;
my $bResult = true;
- # Set debug string and log
- my $strDebug = ($bSourceRemote ? 'remote' : 'local') . " ${strSourcePathType}" .
- (defined($strSourceFile) ? ":${strSourceOp}" : '') .
- ' to' . ($bDestinationRemote ? ' remote' : ' local') . " ${strDestinationPathType}" .
- (defined($strDestinationFile) ? ":${strDestinationOp}" : '') .
- ', source_compressed = ' . ($bSourceCompressed ? 'true' : 'false') .
- ', destination_compress = ' . ($bDestinationCompress ? 'true' : 'false') .
- ', ignore_missing_source = ' . ($bIgnoreMissingSource ? 'true' : 'false') .
- ', destination_path_create = ' . ($bDestinationPathCreate ? 'true' : 'false') .
- ', modification_time = ' . (defined($lModificationTime) ? $lModificationTime : '[undef]') .
- ', mode = ' . (defined($strMode) ? $strMode : '[undef]') .
- ', user = ' . (defined($strUser) ? $strUser : '[undef]') .
- ', group = ' . (defined($strGroup) ? $strGroup : '[undef]');
- &log(DEBUG, OP_FILE_COPY . ": ${strDebug}");
-
# Open the source and destination files (if needed)
my $hSourceFile;
my $hDestinationFile;
@@ -1417,21 +1693,23 @@ sub copy
confess &log(ERROR, $strError, $iErrorCode);
}
- confess &log(ERROR, "${strDebug}: " . $strError, $iErrorCode);
+ confess &log(ERROR, $strError, $iErrorCode);
}
}
if (!$bDestinationRemote)
{
+ my $iCreateFlag = O_WRONLY | O_CREAT | O_EXCL;
+
# Open the destination temp file
- if (!sysopen($hDestinationFile, $strDestinationTmpOp, O_WRONLY | O_CREAT))
+ if (!sysopen($hDestinationFile, $strDestinationTmpOp, $iCreateFlag))
{
if ($bDestinationPathCreate)
{
- $self->path_create(PATH_ABSOLUTE, dirname($strDestinationTmpOp), undef, true);
+ $self->pathCreate(PATH_ABSOLUTE, dirname($strDestinationTmpOp), undef, true);
}
- if (!$bDestinationPathCreate || !sysopen($hDestinationFile, $strDestinationTmpOp, O_WRONLY | O_CREAT))
+ if (!$bDestinationPathCreate || !sysopen($hDestinationFile, $strDestinationTmpOp, $iCreateFlag))
{
my $strError = "unable to open ${strDestinationTmpOp}: " . $!;
my $iErrorCode = COMMAND_ERR_FILE_READ;
@@ -1449,10 +1727,16 @@ sub copy
confess &log(ERROR, $strError, $iErrorCode);
}
- confess &log(ERROR, "${strDebug}: " . $strError);
+ confess &log(ERROR, $strError);
}
}
}
+
+ # Now lock the file to be sure nobody else is operating on it
+ if (!flock($hDestinationFile, LOCK_EX | LOCK_NB))
+ {
+ confess &log(ERROR, "unable to acquire exclusive lock on lock ${strDestinationTmpOp}", ERROR_LOCK_ACQUIRE);
+ }
}
# If source or destination are remote
@@ -1560,15 +1844,6 @@ sub copy
}
}
- # Build debug string
- if (%oParamHash)
- {
- my $strRemote = 'remote (' . $self->{oProtocol}->commandParamString(\%oParamHash) . ')';
- $strDebug = "${strOperation}: ${strRemote}: ${strDebug}";
-
- &log(TRACE, "${strOperation}: ${strRemote}");
- }
-
# If an operation is defined then write it
if (%oParamHash)
{
@@ -1590,7 +1865,7 @@ sub copy
eval
{
- $strOutput = $self->{oProtocol}->outputRead(true, $strDebug, true);
+ $strOutput = $self->{oProtocol}->outputRead(true, undef, true);
# Check the result of the remote call
if (substr($strOutput, 0, 1) eq 'Y')
@@ -1640,7 +1915,7 @@ sub copy
# We'll ignore this error if the source file was missing and missing file exception was returned
# and bIgnoreMissingSource is set
- if ($bIgnoreMissingSource && $strRemote eq 'in' && blessed($oMessage) && $oMessage->isa('BackRest::Exception') &&
+ if ($bIgnoreMissingSource && $strRemote eq 'in' && blessed($oMessage) && $oMessage->isa('BackRest::Common::Exception') &&
$oMessage->code() == COMMAND_ERR_FILE_MISSING)
{
close($hDestinationFile) or confess &log(ERROR, "cannot close file ${strDestinationTmpOp}");
@@ -1702,7 +1977,7 @@ sub copy
!(!$bSourceRemote && $bDestinationRemote && $bSourceCompressed) &&
(!defined($strChecksum) || !defined($iFileSize)))
{
- confess &log(ASSERT, "${strDebug}: checksum or file size not set");
+ confess &log(ASSERT, 'checksum or file size not set');
}
# Where the destination is local, set mode, modification time, and perform move to final location
@@ -1748,7 +2023,14 @@ sub copy
$self->move(PATH_ABSOLUTE, $strDestinationTmpOp, PATH_ABSOLUTE, $strDestinationOp, $bDestinationPathCreate);
}
- return $bResult, $strChecksum, $iFileSize;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'bResult', value => $bResult, trace => true},
+ {name => 'strChecksum', value => $strChecksum, trace => true},
+ {name => 'iFileSize', value => $iFileSize, trace => true}
+ );
}
1;
diff --git a/lib/BackRest/FileCommon.pm b/lib/BackRest/FileCommon.pm
index d445da4fb..c9f39e34b 100644
--- a/lib/BackRest/FileCommon.pm
+++ b/lib/BackRest/FileCommon.pm
@@ -8,19 +8,20 @@ use warnings FATAL => qw(all);
use Carp qw(confess);
use Exporter qw(import);
+ our @EXPORT = qw();
use File::Basename qw(dirname);
use IO::Handle;
use lib dirname($0) . '/../lib';
-use BackRest::Exception;
-use BackRest::Utility;
+use BackRest::Common::Exception;
+use BackRest::Common::Log;
####################################################################################################################################
# Operation constants
####################################################################################################################################
-use constant OP_FILE_COMMON => 'FileCommon';
+use constant OP_FILE_COMMON => 'FileCommon';
-use constant OP_FILE_COMMON_PATH_SYNC => OP_FILE_COMMON . '::filePathSync';
+use constant OP_FILE_COMMON_PATH_SYNC => OP_FILE_COMMON . '::filePathSync';
####################################################################################################################################
# filePathSync
@@ -29,9 +30,17 @@ use constant OP_FILE_COMMON_PATH_SYNC => OP_FILE_COM
####################################################################################################################################
sub filePathSync
{
- my $strPath = shift;
-
- logTrace(OP_FILE_COMMON_PATH_SYNC, DEBUG_CALL, undef, {path => \$strPath});
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strPath
+ ) =
+ logDebugParam
+ (
+ OP_FILE_COMMON_PATH_SYNC, \@_,
+ {name => 'strPath', trace => true}
+ );
open(my $hPath, "<", $strPath)
or confess &log(ERROR, "unable to open ${strPath}", ERROR_PATH_OPEN);
@@ -40,8 +49,14 @@ sub filePathSync
$hPathDup->sync
or confess &log(ERROR, "unable to sync ${strPath}", ERROR_PATH_SYNC);
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation
+ );
}
-our @EXPORT = qw(filePathSync);
+push @EXPORT, qw(filePathSync);
1;
diff --git a/lib/BackRest/Info.pm b/lib/BackRest/Info.pm
index 6d678daa8..daad03a96 100644
--- a/lib/BackRest/Info.pm
+++ b/lib/BackRest/Info.pm
@@ -8,22 +8,27 @@ use warnings FATAL => qw(all);
use Carp qw(confess);
use Exporter qw(import);
+ our @EXPORT = qw();
use File::Basename qw(dirname);
use lib dirname($0);
+use BackRest::Common::Log;
+use BackRest::Common::Ini;
+use BackRest::Common::String;
use BackRest::BackupCommon;
use BackRest::BackupInfo;
use BackRest::Config;
use BackRest::File;
-use BackRest::Ini;
use BackRest::Manifest;
-use BackRest::Utility;
####################################################################################################################################
# Operation constants
####################################################################################################################################
-use constant OP_INFO_LIST_STANZA => 'Info->listStanza';
- our @EXPORT = qw(OP_INFO_LIST_STANZA);
+use constant OP_INFO_BACKUP_LIST => 'Info->backupList';
+use constant OP_INFO_NEW => 'Info->new';
+use constant OP_INFO_PROCESS => 'Info->process';
+use constant OP_INFO_STANZA_LIST => 'Info->stanzaList';
+ push @EXPORT, qw(OP_INFO_STANZA_LIST);
####################################################################################################################################
# Info constants
@@ -75,19 +80,42 @@ sub new
my $self = {};
bless $self, $class;
- # Set variables
- $self->{oFile} = $oFile;
+ # Assign function parameters, defaults, and log debug info
+ (
+ my $strOperation,
+ $self->{oFile}
+ ) =
+ logDebugParam
+ (
+ OP_INFO_NEW, \@_,
+ {name => 'oFile', required => false, trace => true}
+ );
- return $self;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'self', value => $self}
+ );
}
####################################################################################################################################
-# info
+# process
####################################################################################################################################
-sub info
+sub process
{
my $self = shift;
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation
+ ) =
+ logDebugParam
+ (
+ OP_INFO_PROCESS
+ );
+
# Get stanza if specified
my $strStanza = optionTest(OPTION_STANZA) ? optionGet(OPTION_STANZA) : undef;
@@ -101,13 +129,13 @@ sub info
);
# Get the stanza list with all info
- my $oStanzaList = $self->listStanza($oFile, $strStanza);
+ my $oyStanzaList = $self->stanzaList($oFile, $strStanza);
if (optionTest(OPTION_OUTPUT, INFO_OUTPUT_TEXT))
{
my $strOutput;
- foreach my $oStanzaInfo (@{$oStanzaList})
+ foreach my $oStanzaInfo (@{$oyStanzaList})
{
$strOutput = defined($strOutput) ? $strOutput .= "\n" : '';
@@ -121,13 +149,13 @@ sub info
$strOutput .= ' oldest backup label: ' . $$oOldestBackup{&INFO_KEY_LABEL} . "\n";
$strOutput .= ' oldest backup timestamp: ' .
- timestamp_string_get(undef, $$oOldestBackup{&INFO_SECTION_TIMESTAMP}{&INFO_KEY_START}) . "\n";
+ timestampFormat(undef, $$oOldestBackup{&INFO_SECTION_TIMESTAMP}{&INFO_KEY_START}) . "\n";
my $oLatestBackup = $$oStanzaInfo{&INFO_BACKUP_SECTION_BACKUP}[@{$$oStanzaInfo{&INFO_BACKUP_SECTION_BACKUP}} - 1];
$strOutput .= ' latest backup label: ' . $$oLatestBackup{&INFO_KEY_LABEL} . "\n";
$strOutput .= ' latest backup timestamp: ' .
- timestamp_string_get(undef, $$oLatestBackup{&INFO_SECTION_TIMESTAMP}{&INFO_KEY_START}) . "\n";
+ timestampFormat(undef, $$oLatestBackup{&INFO_SECTION_TIMESTAMP}{&INFO_KEY_START}) . "\n";
}
}
@@ -136,7 +164,7 @@ sub info
elsif (optionTest(OPTION_OUTPUT, INFO_OUTPUT_JSON))
{
my $oJSON = JSON::PP->new()->canonical()->pretty()->indent_length(4);
- my $strJSON = $oJSON->encode($oStanzaList);
+ my $strJSON = $oJSON->encode($oyStanzaList);
syswrite(*STDOUT, $strJSON);
@@ -152,24 +180,38 @@ sub info
confess &log(ASSERT, "invalid info output option '" . optionGet(OPTION_OUTPUT) . "'");
}
- return 0;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'iResult', value => 0, trace => true}
+ );
}
####################################################################################################################################
-# listStanza
+# stanzaList
####################################################################################################################################
-sub listStanza
+sub stanzaList
{
my $self = shift;
- my $oFile = shift;
- my $strStanza = shift;
- # Set operation and debug strings
- my $strOperation = OP_INFO_LIST_STANZA;
- &log(DEBUG, "${strOperation}". (defined($strStanza) ? ": stanza = ${strStanza}" : ''));
- my @oStanzaList;
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $oFile,
+ $strStanza
+ ) =
+ logDebugParam
+ (
+ OP_INFO_STANZA_LIST, \@_,
+ {name => 'oFile'},
+ {name => 'strStanza', required => false}
+ );
- if ($oFile->is_remote(PATH_BACKUP))
+ my @oyStanzaList;
+
+ if ($oFile->isRemote(PATH_BACKUP))
{
# Build param hash
my $oParamHash = undef;
@@ -180,13 +222,13 @@ sub listStanza
}
# Trace the remote parameters
- &log(TRACE, "${strOperation}: remote (" . $oFile->{oProtocol}->commandParamString($oParamHash) . ')');
+ &log(TRACE, OP_INFO_STANZA_LIST . ": remote (" . $oFile->{oProtocol}->commandParamString($oParamHash) . ')');
# Execute the command
- my $strStanzaList = $oFile->{oProtocol}->cmdExecute($strOperation, $oParamHash, true);
+ my $strStanzaList = $oFile->{oProtocol}->cmdExecute(OP_INFO_STANZA_LIST, $oParamHash, true);
# Trace the remote response
- &log(TRACE, "${strOperation}: remote json response (${strStanzaList})");
+ &log(TRACE, OP_INFO_STANZA_LIST . ": remote json response (${strStanzaList})");
my $oJSON = JSON::PP->new();
return $oJSON->decode($strStanzaList);
@@ -205,7 +247,7 @@ sub listStanza
my $oStanzaInfo = {};
$$oStanzaInfo{&INFO_STANZA_NAME} = $strStanzaFound;
($$oStanzaInfo{&INFO_BACKUP_SECTION_BACKUP}, $$oStanzaInfo{&INFO_BACKUP_SECTION_DB}) =
- $self->listBackup($oFile, $strStanzaFound);
+ $self->backupList($oFile, $strStanzaFound);
if (@{$$oStanzaInfo{&INFO_BACKUP_SECTION_BACKUP}} == 0)
{
@@ -224,10 +266,10 @@ sub listStanza
};
}
- push @oStanzaList, $oStanzaInfo;
+ push @oyStanzaList, $oStanzaInfo;
}
- if (defined($strStanza) && @oStanzaList == 0)
+ if (defined($strStanza) && @oyStanzaList == 0)
{
my $oStanzaInfo = {};
@@ -242,24 +284,41 @@ sub listStanza
$$oStanzaInfo{&INFO_BACKUP_SECTION_BACKUP} = [];
$$oStanzaInfo{&INFO_BACKUP_SECTION_DB} = [];
- push @oStanzaList, $oStanzaInfo;
+ push @oyStanzaList, $oStanzaInfo;
}
}
- return \@oStanzaList;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'oyStanzaList', value => \@oyStanzaList, log => false, ref => true}
+ );
}
####################################################################################################################################
-# listBackup
+# backupList
###################################################################################################################################
-sub listBackup
+sub backupList
{
my $self = shift;
- my $oFile = shift;
- my $strStanza = shift;
+
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $oFile,
+ $strStanza
+ ) =
+ logDebugParam
+ (
+ OP_INFO_BACKUP_LIST, \@_,
+ {name => 'oFile'},
+ {name => 'strStanza'}
+ );
# Load or build backup.info
- my $oBackupInfo = new BackRest::BackupInfo($oFile->path_get(PATH_BACKUP, CMD_BACKUP . "/${strStanza}"));
+ my $oBackupInfo = new BackRest::BackupInfo($oFile->pathGet(PATH_BACKUP, CMD_BACKUP . "/${strStanza}"));
# Build the db list
my @oyDbList;
@@ -295,14 +354,14 @@ sub listBackup
&INFO_SECTION_BACKREST =>
{
&INFO_KEY_FORMAT =>
- $oBackupInfo->getNumeric(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackup, INI_KEY_FORMAT),
+ $oBackupInfo->numericGet(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackup, INI_KEY_FORMAT),
&INFO_KEY_VERSION =>
$oBackupInfo->get(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackup, INI_KEY_VERSION)
},
&INFO_SECTION_DB =>
{
&INFO_KEY_ID =>
- $oBackupInfo->getNumeric(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackup, INFO_BACKUP_KEY_HISTORY_ID)
+ $oBackupInfo->numericGet(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackup, INFO_BACKUP_KEY_HISTORY_ID)
},
&INFO_SECTION_INFO =>
{
@@ -321,9 +380,9 @@ sub listBackup
&INFO_SECTION_TIMESTAMP =>
{
&INFO_KEY_START =>
- $oBackupInfo->getNumeric(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackup, INFO_BACKUP_KEY_TIMESTAMP_START),
+ $oBackupInfo->numericGet(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackup, INFO_BACKUP_KEY_TIMESTAMP_START),
&INFO_KEY_STOP =>
- $oBackupInfo->getNumeric(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackup, INFO_BACKUP_KEY_TIMESTAMP_STOP),
+ $oBackupInfo->numericGet(INFO_BACKUP_SECTION_BACKUP_CURRENT, $strBackup, INFO_BACKUP_KEY_TIMESTAMP_STOP),
},
&INFO_KEY_LABEL => $strBackup,
&INFO_KEY_PRIOR =>
@@ -337,7 +396,13 @@ sub listBackup
push(@oyBackupList, $oBackupHash);
}
- return \@oyBackupList, \@oyDbList;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'oyBackupList', value => \@oyBackupList, log => false, ref => true},
+ {name => 'oyDbList', value => \@oyDbList, log => false, ref => true}
+ );
}
1;
diff --git a/lib/BackRest/Manifest.pm b/lib/BackRest/Manifest.pm
index 2d97b0ca1..6957819a5 100644
--- a/lib/BackRest/Manifest.pm
+++ b/lib/BackRest/Manifest.pm
@@ -2,30 +2,32 @@
# MANIFEST MODULE
####################################################################################################################################
package BackRest::Manifest;
-use parent 'BackRest::Ini';
+use parent 'BackRest::Common::Ini';
use strict;
use warnings FATAL => qw(all);
use Carp qw(confess);
use Exporter qw(import);
+ our @EXPORT = qw();
use File::Basename qw(dirname basename);
use Digest::SHA;
use Time::Local qw(timelocal);
use lib dirname($0);
-use BackRest::Exception qw(ERROR_CHECKSUM ERROR_FORMAT);
+use BackRest::Common::Exception;
+use BackRest::Common::Ini;
+use BackRest::Common::Log;
use BackRest::File;
-use BackRest::Ini;
-use BackRest::Utility;
####################################################################################################################################
# Operation constants
####################################################################################################################################
use constant OP_MANIFEST => 'Manifest';
- our @EXPORT = qw(OP_MANIFEST);
+
+use constant OP_MANIFEST_BUILD => OP_MANIFEST . '->build';
+use constant OP_MANIFEST_NEW => OP_MANIFEST . '->new';
use constant OP_MANIFEST_SAVE => OP_MANIFEST . '->save';
- push @EXPORT, qw(OP_MANIFEST_SAVE);
####################################################################################################################################
# File/path constants
@@ -133,9 +135,21 @@ use constant MANIFEST_SUBKEY_USER => 'user';
####################################################################################################################################
sub new
{
- my $class = shift; # Class name
- my $strFileName = shift; # Manifest filename
- my $bLoad = shift; # Load the manifest?
+ my $class = shift;
+
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strFileName, # Manifest filename
+ $bLoad # Load the manifest?
+ ) =
+ logDebugParam
+ (
+ OP_MANIFEST_NEW, \@_,
+ {name => 'strFileName', trace => true},
+ {name => 'bLoad', required => false, trace => true}
+ );
# Set defaults
$bLoad = defined($bLoad) ? $bLoad : true;
@@ -143,7 +157,12 @@ sub new
# Init object and store variables
my $self = $class->SUPER::new($strFileName, $bLoad);
- return $self;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'self', value => $self}
+ );
}
####################################################################################################################################
@@ -155,8 +174,18 @@ sub save
{
my $self = shift;
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ ) =
+ logDebugParam
+ (
+ OP_MANIFEST_SAVE
+ );
+
# !!! Add section comments here
- # $self->setComment(MANIFEST_SECTION_BACKUP_INFO,
+ # $self->commentSet(MANIFEST_SECTION_BACKUP_INFO,
# #################################################################################
# "Information about the backup:\n" .
# " backup-size = total size of original files.\n" .
@@ -166,14 +195,20 @@ sub save
# " unless option-start-stop = true.\n" .
# "\n" .
# "Human-readable output:\n" .
- # " backup-repo-size = " . file_size_format($lBackupRepoSize) . "\n" .
- # " backup-repo-size-delta = " . file_size_format($lBackupRepoSizeDelta) . "\n" .
- # " backup-size = " . file_size_format($lBackupSize) . "\n" .
- # " backup-size-delta = " . file_size_format($lBackupSizeDelta)
+ # " backup-repo-size = " . fileSizeFormat($lBackupRepoSize) . "\n" .
+ # " backup-repo-size-delta = " . fileSizeFormat($lBackupRepoSizeDelta) . "\n" .
+ # " backup-size = " . fileSizeFormat($lBackupSize) . "\n" .
+ # " backup-size-delta = " . fileSizeFormat($lBackupSizeDelta)
# );
# Call inherited save
$self->SUPER::save();
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation
+ );
}
####################################################################################################################################
@@ -349,14 +384,28 @@ sub valid
sub build
{
my $self = shift;
- my $oFile = shift;
- my $strDbClusterPath = shift;
- my $oLastManifest = shift;
- my $bNoStartStop = shift;
- my $oTablespaceMapRef = shift;
- my $strLevel = shift;
- &log(DEBUG, 'Manifest->build');
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $oFile,
+ $strDbClusterPath,
+ $oLastManifest,
+ $bNoStartStop,
+ $oTablespaceMapRef,
+ $strLevel
+ ) =
+ logDebugParam
+ (
+ OP_MANIFEST_BUILD, \@_,
+ {name => 'oFile'},
+ {name => 'strDbClusterPath'},
+ {name => 'oLastManifest', required => false},
+ {name => 'bNoStartStop'},
+ {name => 'oTablespaceMapRef', required => false},
+ {name => 'strLevel', required => false}
+ );
# If no level is defined then it must be base
if (!defined($strLevel))
@@ -389,7 +438,7 @@ sub build
confess &log(ERROR, PATH_PG_TBLSPC . "/${strName} is not a link");
}
- &log(DEBUG, "Found tablespace ${strName}");
+ logDebugMisc($strOperation, "found tablespace ${strName}");
${$oTablespaceMapRef}{oid}{$strName}{name} = $strName;
}
@@ -491,22 +540,22 @@ sub build
{
# If modification time is in the future (in this backup OR the last backup) set warning flag and do not
# allow a reference
- if ($self->getNumeric($strSection, $strName, MANIFEST_SUBKEY_TIMESTAMP) > $lTimeBegin ||
+ if ($self->numericGet($strSection, $strName, MANIFEST_SUBKEY_TIMESTAMP) > $lTimeBegin ||
(defined($oLastManifest) && $oLastManifest->test($strSection, $strName, MANIFEST_SUBKEY_FUTURE, 'y')))
{
$bTimeInFuture = true;
# Only mark as future if still in the future in the current backup
- if ($self->getNumeric($strSection, $strName, MANIFEST_SUBKEY_TIMESTAMP) > $lTimeBegin)
+ if ($self->numericGet($strSection, $strName, MANIFEST_SUBKEY_TIMESTAMP) > $lTimeBegin)
{
$self->set($strSection, $strName, MANIFEST_SUBKEY_FUTURE, 'y');
}
}
# Else check if modification time and size are unchanged since last backup
elsif (defined($oLastManifest) && $oLastManifest->test($strSection, $strName) &&
- $self->getNumeric($strSection, $strName, MANIFEST_SUBKEY_SIZE) ==
+ $self->numericGet($strSection, $strName, MANIFEST_SUBKEY_SIZE) ==
$oLastManifest->get($strSection, $strName, MANIFEST_SUBKEY_SIZE) &&
- $self->getNumeric($strSection, $strName, MANIFEST_SUBKEY_TIMESTAMP) ==
+ $self->numericGet($strSection, $strName, MANIFEST_SUBKEY_TIMESTAMP) ==
$oLastManifest->get($strSection, $strName, MANIFEST_SUBKEY_TIMESTAMP))
{
# Copy reference from previous backup if possible
@@ -542,6 +591,12 @@ sub build
# Record the time when copying will start
$self->set(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_TIMESTAMP_COPY_START, undef, $lTimeBegin + 1);
}
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation
+ );
}
1;
diff --git a/lib/BackRest/Protocol/Common.pm b/lib/BackRest/Protocol/Common.pm
index 46871cc3f..5453d9cee 100644
--- a/lib/BackRest/Protocol/Common.pm
+++ b/lib/BackRest/Protocol/Common.pm
@@ -12,11 +12,11 @@ use File::Basename qw(dirname);
use IO::String qw();
use lib dirname($0) . '/../lib';
+use BackRest::Common::Exception;
+use BackRest::Common::Ini;
+use BackRest::Common::Log;
use BackRest::Config;
-use BackRest::Exception;
-use BackRest::Ini;
use BackRest::Protocol::IO;
-use BackRest::Utility;
####################################################################################################################################
# Operation constants
@@ -31,50 +31,40 @@ use constant OP_PROTOCOL_COMMON_NEW => OP_PROTOC
sub new
{
my $class = shift; # Class name
- my $iBlockSize = shift; # Buffer size
- my $iCompressLevel = shift; # Set compression level
- my $iCompressLevelNetwork = shift; # Set compression level for network only compression
- my $strName = shift; # Name to be used for gretting
-
- # Debug
- logTrace(OP_PROTOCOL_COMMON_NEW, DEBUG_CALL, undef,
- {iBlockSize => $iBlockSize, iCompressLevel => $iCompressLevel, iCompressNetworkLevel => $iCompressLevelNetwork});
# Create the class hash
my $self = {};
bless $self, $class;
- # Set default block size
- $self->{iBlockSize} = $iBlockSize;
-
- if (!defined($self->{iBlockSize}))
- {
- confess &log(ASSERT, 'iBlockSize must be set');
- }
-
- # Set compress levels
- $self->{iCompressLevel} = $iCompressLevel;
-
- if (!defined($self->{iCompressLevel}))
- {
- confess &log(ASSERT, 'iCompressLevel must be set');
- }
-
- $self->{iCompressLevelNetwork} = $iCompressLevelNetwork;
-
- if (!defined($self->{iCompressLevelNetwork}))
- {
- confess &log(ASSERT, 'iCompressLevelNetwork must be set');
- }
+ # Assign function parameters, defaults, and log debug info
+ (
+ my $strOperation,
+ $self->{iBlockSize},
+ $self->{iCompressLevel},
+ $self->{iCompressLevelNetwork},
+ $self->{strName}
+ ) =
+ logDebugParam
+ (
+ OP_PROTOCOL_COMMON_NEW, \@_,
+ {name => 'iBlockSize', trace => true},
+ {name => 'iCompressLevel', trace => true},
+ {name => 'iCompressNetworkLevel', trace => true},
+ {name => 'strName', required => false, trace => true}
+ );
# Create the greeting that will be used to check versions with the remote
- if (defined($strName))
+ if (defined($self->{strName}))
{
- $self->{strName} = $strName;
- $self->{strGreeting} = 'PG_BACKREST_' . uc($strName) . ' ' . BACKREST_VERSION;
+ $self->{strGreeting} = 'PG_BACKREST_' . uc($self->{strName}) . ' ' . BACKREST_VERSION;
}
- return $self;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'self', value => $self}
+ );
}
####################################################################################################################################
diff --git a/lib/BackRest/Protocol/CommonMaster.pm b/lib/BackRest/Protocol/CommonMaster.pm
index c2b9dc866..707b89672 100644
--- a/lib/BackRest/Protocol/CommonMaster.pm
+++ b/lib/BackRest/Protocol/CommonMaster.pm
@@ -11,12 +11,12 @@ use Carp qw(confess);
use File::Basename qw(dirname);
use lib dirname($0) . '/../lib';
+use BackRest::Common::Exception;
+use BackRest::Common::Ini;
+use BackRest::Common::Log;
use BackRest::Config;
-use BackRest::Exception;
-use BackRest::Ini;
use BackRest::Protocol::Common;
use BackRest::Protocol::IO;
-use BackRest::Utility;
####################################################################################################################################
# Operation constants
@@ -33,16 +33,26 @@ use constant OP_PROTOCOL_COMMON_MASTER_OUTPUT_READ => OP_PROTOC
sub new
{
my $class = shift; # Class name
- my $strName = shift; # Name of the protocol
- my $strCommand = shift; # Command to execute on local/remote
- my $iBlockSize = shift; # Buffer size
- my $iCompressLevel = shift; # Set compression level
- my $iCompressLevelNetwork = shift; # Set compression level for network only compression
- # Debug
- logDebug(OP_PROTOCOL_COMMON_MASTER_NEW, DEBUG_CALL, undef,
- {name => \$strName, command => \$strCommand, blockSize => $iBlockSize,
- compressLevel => $iCompressLevel, compressLevelNetwork => $iCompressLevelNetwork});
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strName, # Name of the protocol
+ $strCommand, # Command to execute on local/remote
+ $iBlockSize, # Buffer size
+ $iCompressLevel, # Set compression level
+ $iCompressLevelNetwork # Set compression level for network only compression
+ ) =
+ logDebugParam
+ (
+ OP_PROTOCOL_COMMON_MASTER_NEW, \@_,
+ {name => 'strName'},
+ {name => 'strCommand'},
+ {name => 'iBlockSize'},
+ {name => 'iCompressLevel'},
+ {name => 'iCompressLevelNetwork'}
+ );
# Create the class hash
my $self = $class->SUPER::new($iBlockSize, $iCompressLevel, $iCompressLevelNetwork, $strName);
@@ -60,7 +70,12 @@ sub new
# Check greeting to be sure the protocol matches
$self->greetingRead();
- return $self;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'self', value => $self}
+ );
}
####################################################################################################################################
@@ -115,12 +130,22 @@ sub greetingRead
sub outputRead
{
my $self = shift;
- my $bOutputRequired = shift;
- my $strErrorPrefix = shift;
- my $bSuppressLog = shift;
- logTrace(OP_PROTOCOL_COMMON_MASTER_OUTPUT_READ, DEBUG_CALL, undef,
- {isOutputRequired => $bOutputRequired, strErrorPrefix => \$strErrorPrefix, isSuppressLog => $bSuppressLog});
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $bOutputRequired,
+ $strErrorPrefix,
+ $bSuppressLog
+ ) =
+ logDebugParam
+ (
+ OP_PROTOCOL_COMMON_MASTER_OUTPUT_READ, \@_,
+ {name => 'bOutputRequired', default => false, trace => true},
+ {name => 'strErrorPrefix', required => false, trace => true},
+ {name => 'bSuppressLog', required => false, trace => true}
+ );
my $strLine;
my $strOutput;
@@ -165,10 +190,12 @@ sub outputRead
confess &log(ERROR, (defined($strErrorPrefix) ? "${strErrorPrefix}: " : '') . 'output is not defined');
}
- logTrace(OP_PROTOCOL_COMMON_MASTER_OUTPUT_READ, DEBUG_RESULT, undef, {strOutput => \$strOutput});
-
- # Return output
- return $strOutput;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'strOutput', value => $strOutput, trace => true}
+ );
}
####################################################################################################################################
@@ -203,10 +230,20 @@ sub commandParamString
sub cmdWrite
{
my $self = shift;
- my $strCommand = shift;
- my $oParamRef = shift;
- logTrace(OP_PROTOCOL_COMMON_MASTER_COMMAND_WRITE, DEBUG_CALL, \$strCommand, $oParamRef);
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strCommand,
+ $oParamRef,
+ ) =
+ logDebugParam
+ (
+ OP_PROTOCOL_COMMON_MASTER_COMMAND_WRITE, \@_,
+ {name => 'strCommand', trace => true},
+ {name => 'oParamRef', required => false, trace => true}
+ );
if (defined($oParamRef))
{
@@ -235,9 +272,13 @@ sub cmdWrite
$strCommand .= 'end';
}
- $self->{io}->lineWrite($strCommand);
+ logDebugMisc
+ (
+ $strOperation, undef,
+ {name => 'strCommand', value => $strCommand, trace => true}
+ );
- logTrace(OP_PROTOCOL_COMMON_MASTER_COMMAND_WRITE, DEBUG_RESULT, undef, {strCommand => \$strCommand});
+ $self->{io}->lineWrite($strCommand);
}
####################################################################################################################################
diff --git a/lib/BackRest/Protocol/CommonMinion.pm b/lib/BackRest/Protocol/CommonMinion.pm
index 1fd38a2ee..9df6c6dde 100644
--- a/lib/BackRest/Protocol/CommonMinion.pm
+++ b/lib/BackRest/Protocol/CommonMinion.pm
@@ -12,12 +12,13 @@ use File::Basename qw(dirname);
use Scalar::Util qw(blessed);
use lib dirname($0) . '/../lib';
+use BackRest::Common::Exception;
+use BackRest::Common::Ini;
+use BackRest::Common::Log;
+use BackRest::Common::String;
use BackRest::Config;
-use BackRest::Exception;
-use BackRest::Ini;
use BackRest::Protocol::Common;
use BackRest::Protocol::IO;
-use BackRest::Utility;
####################################################################################################################################
# Operation constants
@@ -32,27 +33,29 @@ use constant OP_PROTOCOL_COMMON_MINION_NEW => OP_PROTOC
sub new
{
my $class = shift; # Class name
- my $strName = shift; # Name of the protocol
- my $iBlockSize = shift; # Buffer size
- my $iCompressLevel = shift; # Set compression level
- my $iCompressLevelNetwork = shift; # Set compression level for network only compression
- # Debug
- logTrace(OP_PROTOCOL_COMMON_MINION_NEW, DEBUG_CALL, undef,
- {name => \$strName, blockSize => $iBlockSize, compressLevel => $iCompressLevel,
- compressLevelNetwork => $iCompressLevelNetwork});
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strName, # Name of the protocol
+ $iBlockSize, # Buffer size
+ $iCompressLevel, # Set compression level
+ $iCompressLevelNetwork # Set compression level for network only compression
+ ) =
+ logDebugParam
+ (
+ OP_PROTOCOL_COMMON_MINION_NEW, \@_,
+ {name => 'strName'},
+ {name => 'iBlockSize'},
+ {name => 'iCompressLevel'},
+ {name => 'iCompressLevelNetwork'}
+ );
# Create the class hash
my $self = $class->SUPER::new($iBlockSize, $iCompressLevel, $iCompressLevelNetwork, $strName);
bless $self, $class;
- # Create the greeting that will be used to check versions with the remote
- if (defined($strName))
- {
- $self->{strName} = $strName;
- $self->{strGreeting} = 'PG_BACKREST_' . uc($strName) . ' ' . BACKREST_VERSION;
- }
-
# Create the IO object with std io
$self->{io} = new BackRest::Protocol::IO(*STDIN, *STDOUT, *STDERR);
@@ -119,7 +122,7 @@ sub errorWrite
if (blessed($oMessage))
{
# Check if it is a standard exception
- if ($oMessage->isa('BackRest::Exception'))
+ if ($oMessage->isa('BackRest::Common::Exception'))
{
$iCode = $oMessage->code();
$strMessage = $oMessage->message();
diff --git a/lib/BackRest/Protocol/IO.pm b/lib/BackRest/Protocol/IO.pm
index aae291709..e288fc54c 100644
--- a/lib/BackRest/Protocol/IO.pm
+++ b/lib/BackRest/Protocol/IO.pm
@@ -8,12 +8,14 @@ use warnings FATAL => qw(all);
use Carp qw(confess);
use File::Basename qw(dirname);
-use IPC::Open3;
+use IPC::Open3 qw(open3);
use POSIX qw(:sys_wait_h);
use lib dirname($0) . '/../lib';
-use BackRest::Exception;
-use BackRest::Utility;
+use BackRest::Common::Exception;
+use BackRest::Common::Log;
+use BackRest::Common::String;
+use BackRest::Common::Wait;
####################################################################################################################################
# Operation constants
@@ -28,25 +30,35 @@ use constant OP_IO_PROTOCOL_NEW3 =>
####################################################################################################################################
sub new
{
- my $class = shift; # Class name
- my $hIn = shift; # Input stream
- my $hOut = shift; # Output stream
- my $hErr = shift; # Error stream
- my $pId = shift; # Process ID
-
- # Debug
- logTrace(OP_IO_PROTOCOL_NEW3, DEBUG_CALL);
+ my $class = shift;
# Create the class hash
my $self = {};
bless $self, $class;
- $self->{hIn} = $hIn;
- $self->{hOut} = $hOut;
- $self->{hErr} = $hErr;
- $self->{pId} = $pId;
+ # Assign function parameters, defaults, and log debug info
+ (
+ my $strOperation,
+ $self->{hIn}, # Input stream
+ $self->{hOut}, # Output stream
+ $self->{hErr}, # Error stream
+ $self->{pId} # Process ID
+ ) =
+ logDebugParam
+ (
+ OP_IO_PROTOCOL_NEW, \@_,
+ {name => 'hIn', required => false, trace => true},
+ {name => 'hOut', required => false, trace => true},
+ {name => 'hErr', required => false, trace => true},
+ {name => 'pId', required => false, trace => true}
+ );
- return $self;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'self', value => $self}
+ );
}
####################################################################################################################################
@@ -57,18 +69,30 @@ sub new
sub new3
{
my $class = shift;
- my $strCommand = shift;
- # Debug
- logTrace(OP_IO_PROTOCOL_NEW3, DEBUG_CALL, undef, {command => \$strCommand});
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strCommand
+ ) =
+ logDebugParam
+ (
+ OP_IO_PROTOCOL_NEW3, \@_,
+ {name => 'strCommand', trace => true}
+ );
# Use open3 to run the command
my ($pId, $hIn, $hOut, $hErr);
$pId = IPC::Open3::open3($hIn, $hOut, $hErr, $strCommand);
- # Return the IO class
- return $class->new($hOut, $hIn, $hErr, $pId);
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'self', value => $class->new($hOut, $hIn, $hErr, $pId)}
+ );
}
####################################################################################################################################
diff --git a/lib/BackRest/Protocol/RemoteMaster.pm b/lib/BackRest/Protocol/RemoteMaster.pm
index bcfca4e33..6b867957d 100644
--- a/lib/BackRest/Protocol/RemoteMaster.pm
+++ b/lib/BackRest/Protocol/RemoteMaster.pm
@@ -11,9 +11,9 @@ use Carp qw(confess);
use File::Basename qw(dirname);
use lib dirname($0) . '/../lib';
+use BackRest::Common::Log;
use BackRest::Config;
use BackRest::Protocol::CommonMaster;
-use BackRest::Utility;
####################################################################################################################################
# Operation constants
@@ -27,36 +27,29 @@ use constant OP_PROTOCOL_REMOTE_MASTER_NEW => OP_PROTOC
####################################################################################################################################
sub new
{
- my $class = shift; # Class name
- my $strCommand = shift; # Command to execute on local/remote
- my $iBlockSize = shift; # Buffer size
- my $iCompressLevel = shift; # Set compression level
- my $iCompressLevelNetwork = shift; # Set compression level for network only compression
- my $strHost = shift; # Host to connect to for remote (optional as this can also be used for local)
- my $strUser = shift; # User to connect to for remote (must be set if strHost is set)
+ my $class = shift;
- # Debug
- logDebug(OP_PROTOCOL_REMOTE_MASTER_NEW, DEBUG_CALL, undef,
- {command => \$strCommand, host => \$strHost, user => \$strUser, blockSize => $iBlockSize,
- compressLevel => $iCompressLevel, compressLevelNetwork => $iCompressLevelNetwork});
-
- # Host must be defined
- if (!defined($strHost))
- {
- confess &log(ASSERT, 'strHost must be defined');
- }
-
- # User must be defined
- if (!defined($strUser))
- {
- confess &log(ASSERT, 'strUser must be defined');
- }
-
- # Command must be defined
- if (!defined($strCommand))
- {
- confess &log(ASSERT, 'strCommand must be defined');
- }
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $strCommand, # Command to execute on local/remote
+ $iBlockSize, # Buffer size
+ $iCompressLevel, # Set compression level
+ $iCompressLevelNetwork, # Set compression level for network only compression
+ $strHost, # Host to connect to for remote (optional as this can also be used for local)
+ $strUser # User to connect to for remote (must be set if strHost is set)
+ ) =
+ logDebugParam
+ (
+ OP_PROTOCOL_REMOTE_MASTER_NEW, \@_,
+ {name => 'strCommand'},
+ {name => 'iBlockSize'},
+ {name => 'iCompressLevel'},
+ {name => 'iCompressLevelNetwork'},
+ {name => 'strHost'},
+ {name => 'strUser'}
+ );
# Create SSH command
$strCommand = "ssh -o Compression=no -o PasswordAuthentication=no ${strUser}\@${strHost} '${strCommand}'";
@@ -65,7 +58,12 @@ sub new
my $self = $class->SUPER::new('remote', $strCommand, $iBlockSize, $iCompressLevel, $iCompressLevelNetwork);
bless $self, $class;
- return $self;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'self', value => $self}
+ );
}
####################################################################################################################################
diff --git a/lib/BackRest/Protocol/RemoteMinion.pm b/lib/BackRest/Protocol/RemoteMinion.pm
index 46ffa4806..5edb919a2 100644
--- a/lib/BackRest/Protocol/RemoteMinion.pm
+++ b/lib/BackRest/Protocol/RemoteMinion.pm
@@ -11,21 +11,21 @@ use Carp qw(confess);
use File::Basename qw(dirname);
use lib dirname($0) . '/../lib';
+use BackRest::Common::Exception;
+use BackRest::Common::Log;
use BackRest::Archive;
use BackRest::Config;
use BackRest::Db;
-use BackRest::Exception;
use BackRest::File;
use BackRest::Info;
use BackRest::Protocol::CommonMinion;
-use BackRest::Utility;
####################################################################################################################################
# Operation constants
####################################################################################################################################
-use constant OP_PROTOCOL_REMOVE_MINION => 'Protocol::RemoteMinion';
+use constant OP_PROTOCOL_REMOTE_MINION => 'Protocol::RemoteMinion';
-use constant OP_PROTOCOL_REMOVE_MINION_NEW => OP_PROTOCOL_REMOVE_MINION . "->new";
+use constant OP_PROTOCOL_REMOTE_MINION_NEW => OP_PROTOCOL_REMOTE_MINION . "->new";
####################################################################################################################################
# Operation constants
@@ -42,19 +42,33 @@ use constant
sub new
{
my $class = shift; # Class name
- my $iBlockSize = shift; # Buffer size
- my $iCompressLevel = shift; # Set compression level
- my $iCompressLevelNetwork = shift; # Set compression level for network only compression
- # Debug
- logTrace(OP_PROTOCOL_REMOVE_MINION_NEW, DEBUG_CALL, undef,
- {iBlockSize => $iBlockSize, iCompressLevel => $iCompressLevel, iCompressNetworkLevel => $iCompressLevelNetwork});
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $iBlockSize, # Buffer size
+ $iCompressLevel, # Set compression level
+ $iCompressLevelNetwork # Set compression level for network only compression
+ ) =
+ logDebugParam
+ (
+ OP_PROTOCOL_REMOTE_MINION_NEW, \@_,
+ {name => 'iBlockSize', trace => true},
+ {name => 'iCompressLevel', trace => true},
+ {name => 'iCompressNetworkLevel', trace => true}
+ );
# Init object and store variables
my $self = $class->SUPER::new(CMD_REMOTE, $iBlockSize, $iCompressLevel, $iCompressLevelNetwork);
bless $self, $class;
- return $self;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'self', value => $self}
+ );
}
####################################################################################################################################
@@ -188,7 +202,7 @@ sub process
# Create a path
elsif ($strCommand eq OP_FILE_PATH_CREATE)
{
- $oFile->path_create(PATH_ABSOLUTE, paramGet(\%oParamHash, 'path'), paramGet(\%oParamHash, 'mode', false));
+ $oFile->pathCreate(PATH_ABSOLUTE, paramGet(\%oParamHash, 'path'), paramGet(\%oParamHash, 'mode', false));
$self->outputWrite();
}
# Check if a file/path exists
@@ -243,12 +257,12 @@ sub process
$self->outputWrite($oArchive->getCheck($oFile));
}
# Info list stanza
- elsif ($strCommand eq OP_INFO_LIST_STANZA)
+ elsif ($strCommand eq OP_INFO_STANZA_LIST)
{
$self->outputWrite(
$oJSON->encode(
- $oInfo->listStanza($oFile,
- paramGet(\%oParamHash, 'stanza', false))));
+ $oInfo->stanzaList($oFile,
+ paramGet(\%oParamHash, 'stanza', false))));
}
elsif ($strCommand eq OP_DB_INFO)
{
diff --git a/lib/BackRest/ThreadGroup.pm b/lib/BackRest/Protocol/ThreadGroup.pm
similarity index 96%
rename from lib/BackRest/ThreadGroup.pm
rename to lib/BackRest/Protocol/ThreadGroup.pm
index b475eb71e..3708636ef 100644
--- a/lib/BackRest/ThreadGroup.pm
+++ b/lib/BackRest/Protocol/ThreadGroup.pm
@@ -1,7 +1,7 @@
####################################################################################################################################
-# THREADGROUP MODULE
+# COMMON THREADGROUP MODULE
####################################################################################################################################
-package BackRest::ThreadGroup;
+package BackRest::Protocol::ThreadGroup;
use threads;
use strict;
@@ -9,19 +9,19 @@ use warnings FATAL => qw(all);
use Carp qw(confess);
use Exporter qw(import);
+ our @EXPORT = qw();
use File::Basename;
use lib dirname($0) . '/../lib';
+use BackRest::Common::Log;
+use BackRest::Common::Wait;
use BackRest::Config;
use BackRest::BackupFile;
use BackRest::RestoreFile;
-use BackRest::Utility;
####################################################################################################################################
-# MODULE EXPORTS
+# Module globals
####################################################################################################################################
-our @EXPORT = qw(threadGroupCreate threadGroupRun threadGroupComplete threadGroupDestroy);
-
my @oyThread;
my @oyMessageQueue;
my @oyCommandQueue;
@@ -56,6 +56,8 @@ sub threadGroupCreate
}
}
+push @EXPORT, qw(threadGroupCreate);
+
####################################################################################################################################
# threadGroupThread
####################################################################################################################################
@@ -251,6 +253,8 @@ sub threadGroupRun
$byThreadRunning[$iThreadIdx] = true;
}
+push @EXPORT, qw(threadGroupRun);
+
####################################################################################################################################
# threadGroupComplete
#
@@ -276,7 +280,7 @@ sub threadGroupComplete
# Rejoin the threads
# while ($iThreadComplete < @oyThread)
# {
- hsleep(.1);
+ waitHiRes(.1);
# If a timeout has been defined, make sure we have not been running longer than that
if (defined($iTimeout))
@@ -297,7 +301,7 @@ sub threadGroupComplete
{
my $strError;
- if ($oError->isa('BackRest::Exception'))
+ if ($oError->isa('BackRest::Common::Exception'))
{
$strError = $oError->message();
}
@@ -347,6 +351,8 @@ sub threadGroupComplete
return false;
}
+push @EXPORT, qw(threadGroupComplete);
+
####################################################################################################################################
# threadGroupDestroy
####################################################################################################################################
@@ -362,7 +368,7 @@ sub threadGroupDestroy
$oCommand{function} = 'exit';
$oyCommandQueue[$iThreadIdx]->enqueue(\%oCommand);
- hsleep(.1);
+ waitHiRes(.1);
if ($oyThread[$iThreadIdx]->is_running())
{
@@ -383,4 +389,6 @@ sub threadGroupDestroy
return(@oyThread);
}
+push @EXPORT, qw(threadGroupDestroy);
+
1;
diff --git a/lib/BackRest/Restore.pm b/lib/BackRest/Restore.pm
index fc18f442f..f93e3e809 100644
--- a/lib/BackRest/Restore.pm
+++ b/lib/BackRest/Restore.pm
@@ -14,20 +14,36 @@ use File::Basename qw(dirname);
use File::stat qw(lstat);
use lib dirname($0);
+use BackRest::Common::Exception;
+use BackRest::Common::Log;
use BackRest::Config;
use BackRest::Db;
-use BackRest::Exception;
use BackRest::File;
use BackRest::Manifest;
+use BackRest::Protocol::ThreadGroup;
use BackRest::RestoreFile;
-use BackRest::ThreadGroup;
-use BackRest::Utility;
+
+####################################################################################################################################
+# Operation constants
+####################################################################################################################################
+use constant OP_RESTORE => 'Restore';
+
+use constant OP_RESTORE_BUILD => OP_RESTORE . '->build';
+use constant OP_RESTORE_CLEAN => OP_RESTORE . '->clean';
+use constant OP_RESTORE_MANIFEST_LOAD => OP_RESTORE . '->manifestLoad';
+use constant OP_RESTORE_MANIFEST_OWNERSHIP_CHECK => OP_RESTORE . '->manifestOwnershipCheck';
+use constant OP_RESTORE_NEW => OP_RESTORE . '->new';
+use constant OP_RESTORE_PROCESS => OP_RESTORE . '->process';
+use constant OP_RESTORE_RECOVERY => OP_RESTORE . '->recovery';
####################################################################################################################################
# File constants
####################################################################################################################################
-use constant FILE_RECOVERY_CONF => 'recovery.conf'; # Conf file with settings for recovery after restore
-use constant FILE_TABLESPACE_MAP => 'tablespace_map'; # Tablespace map introduced in 9.5
+# Conf file with settings for recovery after restore
+use constant FILE_RECOVERY_CONF => 'recovery.conf';
+
+# Tablespace map introduced in 9.5
+use constant FILE_TABLESPACE_MAP => 'tablespace_map';
####################################################################################################################################
# CONSTRUCTOR
@@ -35,58 +51,55 @@ use constant FILE_TABLESPACE_MAP => 'tablespace_map'; # Tablespace map introdu
sub new
{
my $class = shift; # Class name
- my $strDbClusterPath = shift; # Database cluster path
- my $strBackupPath = shift; # Backup to restore
- my $oRemapRef = shift; # Tablespace remaps
- my $oFile = shift; # Default file object
- my $iThreadTotal = shift; # Total threads to run for restore
- my $bDelta = shift; # perform delta restore
- my $bForce = shift; # force a restore
- my $strType = shift; # Recovery type
- my $strTarget = shift; # Recovery target
- my $bTargetExclusive = shift; # Target exlusive option
- my $bTargetResume = shift; # Target resume option
- my $strTargetTimeline = shift; # Target timeline option
- my $oRecoveryRef = shift; # Other recovery options
- my $strStanza = shift; # Restore stanza
- my $strBackRestBin = shift; # Absolute backrest filename
- my $strConfigFile = shift; # Absolute config filename (optional)
# Create the class hash
my $self = {};
bless $self, $class;
- # Initialize variables
- $self->{strDbClusterPath} = $strDbClusterPath;
- $self->{strBackupPath} = $strBackupPath;
- $self->{oRemapRef} = $oRemapRef;
- $self->{oFile} = $oFile;
- $self->{iThreadTotal} = defined($iThreadTotal) ? $iThreadTotal : 1;
- $self->{bDelta} = $bDelta;
- $self->{bForce} = $bForce;
- $self->{strType} = $strType;
- $self->{strTarget} = $strTarget;
- $self->{bTargetExclusive} = $bTargetExclusive;
- $self->{bTargetResume} = $bTargetResume;
- $self->{strTargetTimeline} = $strTargetTimeline;
- $self->{oRecoveryRef} = $oRecoveryRef;
- $self->{strStanza} = $strStanza;
- $self->{strBackRestBin} = $strBackRestBin;
- $self->{strConfigFile} = $strConfigFile;
+ # Assign function parameters, defaults, and log debug info
+ (
+ my $strOperation,
+ $self->{oFile}
+ ) =
+ logDebugParam
+ (
+ OP_RESTORE_NEW, \@_,
+ {name => 'oFile', trace => true}
+ );
- return $self;
+ # Initialize variables
+ $self->{strDbClusterPath} = optionGet(OPTION_DB_PATH);
+ $self->{strBackupSet} = optionGet(OPTION_SET);
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'self', value => $self}
+ );
}
####################################################################################################################################
-# MANIFEST_OWNERSHIP_CHECK
+# manifestOwnershipCheck
#
# Checks the users and groups that exist in the manifest and emits warnings for ownership that cannot be set properly, either
# because the current user does not have permissions or because the user/group does not exist.
####################################################################################################################################
-sub manifest_ownership_check
+sub manifestOwnershipCheck
{
my $self = shift; # Class hash
- my $oManifest = shift; # Backup manifest
+
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $oManifest # Backup manifest
+ ) =
+ logDebugParam
+ (
+ OP_RESTORE_MANIFEST_OWNERSHIP_CHECK, \@_,
+ {name => 'oManifest', trace => true}
+ );
# Create hashes to track valid/invalid users/groups
my %oOwnerHash = ();
@@ -168,111 +181,125 @@ sub manifest_ownership_check
}
}
}
+
+ # Return from function and log return values if any
+ return logDebugReturn($strOperation);
}
####################################################################################################################################
-# MANIFEST_LOAD
+# manifestLoad
#
# Loads the backup manifest and performs requested tablespace remaps.
####################################################################################################################################
-sub manifest_load
+sub manifestLoad
{
my $self = shift; # Class hash
- if ($self->{oFile}->exists(PATH_BACKUP_CLUSTER, $self->{strBackupPath}))
+ # Assign function parameters, defaults, and log debug info
+ my ($strOperation) = logDebugParam (OP_RESTORE_MANIFEST_LOAD);
+
+ # Error if the backup set does not exist
+ if (!$self->{oFile}->exists(PATH_BACKUP_CLUSTER, $self->{strBackupSet}))
{
- # Copy the backup manifest to the db cluster path
- $self->{oFile}->copy(PATH_BACKUP_CLUSTER, $self->{strBackupPath} . '/' . FILE_MANIFEST,
- PATH_DB_ABSOLUTE, $self->{strDbClusterPath} . '/' . FILE_MANIFEST);
-
- # Load the manifest into a hash
- my $oManifest = new BackRest::Manifest($self->{oFile}->path_get(PATH_DB_ABSOLUTE,
- $self->{strDbClusterPath} . '/' . FILE_MANIFEST));
-
- # Remove the manifest now that it is in memory
- $self->{oFile}->remove(PATH_DB_ABSOLUTE, $self->{strDbClusterPath} . '/' . FILE_MANIFEST);
-
- # If backup is latest then set it equal to backup label, else verify that requested backup and label match
- my $strBackupLabel = $oManifest->get(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_LABEL);
-
- if ($self->{strBackupPath} eq OPTION_DEFAULT_RESTORE_SET)
- {
- $self->{strBackupPath} = $strBackupLabel;
- }
- elsif ($self->{strBackupPath} ne $strBackupLabel)
- {
- confess &log(ASSERT, "request backup $self->{strBackupPath} and label ${strBackupLabel} do not match " .
- ' - this indicates some sort of corruption (at the very least paths have been renamed)');
- }
-
- if ($self->{strDbClusterPath} ne $oManifest->get(MANIFEST_SECTION_BACKUP_PATH, MANIFEST_KEY_BASE, MANIFEST_SUBKEY_PATH))
- {
- &log(INFO, 'remap base path to ' . $self->{strDbClusterPath});
- $oManifest->set(MANIFEST_SECTION_BACKUP_PATH, MANIFEST_KEY_BASE, MANIFEST_SUBKEY_PATH, $self->{strDbClusterPath});
- }
-
- # If no tablespaces are requested
- if (!optionGet(OPTION_TABLESPACE))
- {
- foreach my $strPathKey ($oManifest->keys(MANIFEST_SECTION_BACKUP_PATH))
- {
- if ($oManifest->test(MANIFEST_SECTION_BACKUP_PATH, $strPathKey, MANIFEST_SUBKEY_LINK))
- {
- my $strTablespaceKey =
- $oManifest->get(MANIFEST_SECTION_BACKUP_PATH, $strPathKey, MANIFEST_SUBKEY_LINK);
- my $strTablespaceLink = "pg_tblspc/${strTablespaceKey}";
- my $strTablespacePath =
- $oManifest->get(MANIFEST_SECTION_BACKUP_PATH, MANIFEST_KEY_BASE, MANIFEST_SUBKEY_PATH) .
- "/${strTablespaceLink}";
-
- $oManifest->set(MANIFEST_SECTION_BACKUP_PATH, $strPathKey, MANIFEST_SUBKEY_PATH, $strTablespacePath);
-
- $oManifest->remove('base:link', $strTablespaceLink);
- $oManifest->set('base:path', $strTablespaceLink, MANIFEST_SUBKEY_GROUP,
- $oManifest->get('base:path', '.', MANIFEST_SUBKEY_GROUP));
- $oManifest->set('base:path', $strTablespaceLink, MANIFEST_SUBKEY_USER,
- $oManifest->get('base:path', '.', MANIFEST_SUBKEY_USER));
- $oManifest->set('base:path', $strTablespaceLink, MANIFEST_SUBKEY_MODE,
- $oManifest->get('base:path', '.', MANIFEST_SUBKEY_MODE));
-
- &log(INFO, "remapping tablespace ${strTablespaceKey} to ${strTablespacePath}");
- }
- }
- }
- # If tablespaces have been remapped, update the manifest
- elsif (defined($self->{oRemapRef}))
- {
- foreach my $strTablespaceKey (sort(keys(%{$self->{oRemapRef}})))
- {
- my $strRemapPath = ${$self->{oRemapRef}}{$strTablespaceKey};
- my $strPathKey = "tablespace/${strTablespaceKey}";
-
- # Make sure that the tablespace exists in the manifest
- if (!$oManifest->test(MANIFEST_SECTION_BACKUP_PATH, $strPathKey, MANIFEST_SUBKEY_LINK))
- {
- confess &log(ERROR, "cannot remap invalid tablespace ${strTablespaceKey} to ${strRemapPath}");
- }
-
- # Remap the tablespace in the manifest
- &log(INFO, "remap tablespace ${strTablespaceKey} to ${strRemapPath}");
-
- my $strTablespaceLink = $oManifest->get(MANIFEST_SECTION_BACKUP_PATH, $strPathKey, MANIFEST_SUBKEY_LINK);
-
- $oManifest->set(MANIFEST_SECTION_BACKUP_PATH, $strPathKey, MANIFEST_SUBKEY_PATH, $strRemapPath);
- $oManifest->set('base:link', "pg_tblspc/${strTablespaceLink}", MANIFEST_SUBKEY_DESTINATION, $strRemapPath);
- }
- }
-
- $self->manifest_ownership_check($oManifest);
-
- return $oManifest;
+ confess &log(ERROR, 'backup ' . $self->{strBackupSet} . ' does not exist');
}
- confess &log(ERROR, 'backup ' . $self->{strBackupPath} . ' does not exist');
+ # Copy the backup manifest to the db cluster path
+ $self->{oFile}->copy(PATH_BACKUP_CLUSTER, $self->{strBackupSet} . '/' . FILE_MANIFEST,
+ PATH_DB_ABSOLUTE, $self->{strDbClusterPath} . '/' . FILE_MANIFEST);
+
+ # Load the manifest into a hash
+ my $oManifest = new BackRest::Manifest($self->{oFile}->pathGet(PATH_DB_ABSOLUTE,
+ $self->{strDbClusterPath} . '/' . FILE_MANIFEST));
+
+ # Remove the manifest now that it is in memory
+ $self->{oFile}->remove(PATH_DB_ABSOLUTE, $self->{strDbClusterPath} . '/' . FILE_MANIFEST);
+
+ # If backup is latest then set it equal to backup label, else verify that requested backup and label match
+ my $strBackupLabel = $oManifest->get(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_LABEL);
+
+ if ($self->{strBackupSet} eq OPTION_DEFAULT_RESTORE_SET)
+ {
+ $self->{strBackupSet} = $strBackupLabel;
+ }
+ elsif ($self->{strBackupSet} ne $strBackupLabel)
+ {
+ confess &log(ASSERT, "request backup $self->{strBackupSet} and label ${strBackupLabel} do not match " .
+ ' - this indicates some sort of corruption (at the very least paths have been renamed)');
+ }
+
+ if ($self->{strDbClusterPath} ne $oManifest->get(MANIFEST_SECTION_BACKUP_PATH, MANIFEST_KEY_BASE, MANIFEST_SUBKEY_PATH))
+ {
+ &log(INFO, 'remap base path to ' . $self->{strDbClusterPath});
+ $oManifest->set(MANIFEST_SECTION_BACKUP_PATH, MANIFEST_KEY_BASE, MANIFEST_SUBKEY_PATH, $self->{strDbClusterPath});
+ }
+
+ # If no tablespaces are requested
+ if (!optionGet(OPTION_TABLESPACE))
+ {
+ foreach my $strPathKey ($oManifest->keys(MANIFEST_SECTION_BACKUP_PATH))
+ {
+ if ($oManifest->test(MANIFEST_SECTION_BACKUP_PATH, $strPathKey, MANIFEST_SUBKEY_LINK))
+ {
+ my $strTablespaceKey =
+ $oManifest->get(MANIFEST_SECTION_BACKUP_PATH, $strPathKey, MANIFEST_SUBKEY_LINK);
+ my $strTablespaceLink = "pg_tblspc/${strTablespaceKey}";
+ my $strTablespacePath =
+ $oManifest->get(MANIFEST_SECTION_BACKUP_PATH, MANIFEST_KEY_BASE, MANIFEST_SUBKEY_PATH) .
+ "/${strTablespaceLink}";
+
+ $oManifest->set(MANIFEST_SECTION_BACKUP_PATH, $strPathKey, MANIFEST_SUBKEY_PATH, $strTablespacePath);
+
+ $oManifest->remove('base:link', $strTablespaceLink);
+ $oManifest->set('base:path', $strTablespaceLink, MANIFEST_SUBKEY_GROUP,
+ $oManifest->get('base:path', '.', MANIFEST_SUBKEY_GROUP));
+ $oManifest->set('base:path', $strTablespaceLink, MANIFEST_SUBKEY_USER,
+ $oManifest->get('base:path', '.', MANIFEST_SUBKEY_USER));
+ $oManifest->set('base:path', $strTablespaceLink, MANIFEST_SUBKEY_MODE,
+ $oManifest->get('base:path', '.', MANIFEST_SUBKEY_MODE));
+
+ &log(INFO, "remap tablespace ${strTablespaceKey} to ${strTablespacePath}");
+ }
+ }
+ }
+ # If tablespaces have been remapped, update the manifest
+ elsif (optionTest(OPTION_RESTORE_TABLESPACE_MAP))
+ {
+ my $oRemapRef = optionGet(OPTION_RESTORE_TABLESPACE_MAP);
+
+ foreach my $strTablespaceKey (sort(keys(%$oRemapRef)))
+ {
+ my $strRemapPath = $$oRemapRef{$strTablespaceKey};
+ my $strPathKey = "tablespace/${strTablespaceKey}";
+
+ # Make sure that the tablespace exists in the manifest
+ if (!$oManifest->test(MANIFEST_SECTION_BACKUP_PATH, $strPathKey, MANIFEST_SUBKEY_LINK))
+ {
+ confess &log(ERROR, "cannot remap invalid tablespace ${strTablespaceKey} to ${strRemapPath}");
+ }
+
+ # Remap the tablespace in the manifest
+ &log(INFO, "remap tablespace ${strTablespaceKey} to ${strRemapPath}");
+
+ my $strTablespaceLink = $oManifest->get(MANIFEST_SECTION_BACKUP_PATH, $strPathKey, MANIFEST_SUBKEY_LINK);
+
+ $oManifest->set(MANIFEST_SECTION_BACKUP_PATH, $strPathKey, MANIFEST_SUBKEY_PATH, $strRemapPath);
+ $oManifest->set('base:link', "pg_tblspc/${strTablespaceLink}", MANIFEST_SUBKEY_DESTINATION, $strRemapPath);
+ }
+ }
+
+ $self->manifestOwnershipCheck($oManifest);
+
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'oManifest', value => $oManifest, trace => true}
+ );
}
####################################################################################################################################
-# CLEAN
+# clean
#
# Checks that the restore paths are empty, or if --force was used then it cleans files/paths/links from the restore directories that
# are not present in the manifest.
@@ -280,7 +307,19 @@ sub manifest_load
sub clean
{
my $self = shift; # Class hash
- my $oManifest = shift; # Backup manifest
+
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $oManifest # Backup manifest
+
+ ) =
+ logDebugParam
+ (
+ OP_RESTORE_CLEAN, \@_,
+ {name => 'oManifest', trace => true}
+ );
# Track if files/links/paths where removed
my %oRemoveHash = (&MANIFEST_FILE => 0, &MANIFEST_PATH => 0, &MANIFEST_LINK => 0);
@@ -291,7 +330,7 @@ sub clean
{
my $strPath = $oManifest->get(MANIFEST_SECTION_BACKUP_PATH, $strPathKey, MANIFEST_SUBKEY_PATH);
- &log(INFO, "checking/cleaning db path ${strPath}");
+ &log(INFO, "check/clean db path ${strPath}");
if (!$self->{oFile}->exists(PATH_DB_ABSOLUTE, $strPath))
{
@@ -311,7 +350,7 @@ sub clean
}
# If force was not specified then error if any file is found
- if (!$self->{bForce} && !$self->{bDelta})
+ if (!optionGet(OPTION_FORCE) && !optionGet(OPTION_DELTA))
{
confess &log(ERROR, "cannot restore to path '${strPath}' that contains files - " .
'try using --delta if this is what you intended', ERROR_RESTORE_PATH_NOT_EMPTY);
@@ -344,7 +383,7 @@ sub clean
if ($strUser ne $oPathManifest{name}{$strName}{user} ||
$strGroup ne $oPathManifest{name}{$strName}{group})
{
- &log(INFO, "setting ${strFile} ownership to ${strUser}:${strGroup}");
+ &log(INFO, "set ownership ${strUser}:${strGroup} on ${strFile}");
$self->{oFile}->owner(PATH_DB_ABSOLUTE, $strFile, $strUser, $strGroup);
}
@@ -355,8 +394,10 @@ sub clean
if ($strType eq MANIFEST_LINK && $oManifest->get($strSection, $strName, MANIFEST_SUBKEY_DESTINATION) ne
$oPathManifest{name}{$strName}{link_destination})
{
- &log(INFO, "removing link ${strFile} - destination changed");
- unlink($strFile) or confess &log(ERROR, "unable to delete file ${strFile}");
+ &log(INFO, "remove link ${strFile} - destination changed");
+
+ unlink($strFile)
+ or confess &log(ERROR, "unable to remove link ${strFile}");
}
}
# Else if file/path mode does not match, fix it
@@ -366,10 +407,10 @@ sub clean
if ($strType ne MANIFEST_LINK && $strMode ne $oPathManifest{name}{$strName}{mode})
{
- &log(INFO, "setting ${strFile} mode to ${strMode}");
+ &log(INFO, "set mode ${strMode} on ${strFile}");
chmod(oct($strMode), $strFile)
- or confess 'unable to set mode ${strMode} for ${strFile}';
+ or confess 'unable to set mode ${strMode} on ${strFile}';
}
}
}
@@ -379,7 +420,7 @@ sub clean
# If a path then remove it, all the files should have already been deleted since we are going in reverse order
if ($strType eq MANIFEST_PATH)
{
- &log(INFO, "removing path ${strFile}");
+ &log(INFO, "remove path ${strFile}");
rmdir($strFile) or confess &log(ERROR, "unable to delete path ${strFile}, is it empty?");
}
# Else delete a file/link
@@ -389,7 +430,7 @@ sub clean
# preserved. It will be written/deleted/preserved as needed in recovery().
if (!($strName eq FILE_RECOVERY_CONF && $strType eq MANIFEST_FILE))
{
- &log(INFO, "removing file/link ${strFile}");
+ &log(INFO, "remove file/link ${strFile}");
unlink($strFile) or confess &log(ERROR, "unable to delete file/link ${strFile}");
}
}
@@ -400,24 +441,46 @@ sub clean
}
# Loop through types (path, link, file) and emit info if any were removed
+ my @stryMessage;
+
foreach my $strFileType (sort (keys %oRemoveHash))
{
if ($oRemoveHash{$strFileType} > 0)
{
- &log(INFO, "$oRemoveHash{$strFileType} ${strFileType}(s) removed during cleanup");
+ push(@stryMessage, "$oRemoveHash{$strFileType} ${strFileType}" . ($oRemoveHash{$strFileType} > 1 ? 's' : ''));
}
}
+
+ if (@stryMessage)
+ {
+ &log(INFO, 'cleanup removed ' . join(', ', @stryMessage));
+ }
+
+ # Return from function and log return values if any
+ return logDebugReturn($strOperation);
}
####################################################################################################################################
-# BUILD
+# build
#
# Creates missing paths and links and corrects ownership/mode on existing paths and links.
####################################################################################################################################
sub build
{
my $self = shift; # Class hash
- my $oManifest = shift; # Backup manifest
+
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $oManifest # Backup manifest
+
+ ) =
+ logDebugParam
+ (
+ OP_RESTORE_BUILD, \@_,
+ {name => 'oManifest', trace => true}
+ );
# Build paths/links in each restore path
foreach my $strSectionPathKey ($oManifest->keys(MANIFEST_SECTION_BACKUP_PATH))
@@ -440,7 +503,7 @@ sub build
if (!$self->{oFile}->exists(PATH_DB_ABSOLUTE, $strPath))
{
- $self->{oFile}->path_create(PATH_DB_ABSOLUTE, $strPath,
+ $self->{oFile}->pathCreate(PATH_DB_ABSOLUTE, $strPath,
$oManifest->get($strSection, $strName, MANIFEST_SUBKEY_MODE));
}
}
@@ -456,7 +519,7 @@ sub build
if (!$self->{oFile}->exists(PATH_DB_ABSOLUTE, $strLink))
{
- $self->{oFile}->link_create(PATH_DB_ABSOLUTE,
+ $self->{oFile}->linkCreate(PATH_DB_ABSOLUTE,
$oManifest->get($strSection, $strName, MANIFEST_SUBKEY_DESTINATION),
PATH_DB_ABSOLUTE, $strLink);
}
@@ -474,10 +537,13 @@ sub build
confess &log(ERROR, "required db path '${strPath}' does not exist");
}
}
+
+ # Return from function and log return values if any
+ return logDebugReturn($strOperation);
}
####################################################################################################################################
-# RECOVERY
+# recovery
#
# Creates the recovery.conf file.
####################################################################################################################################
@@ -485,6 +551,9 @@ sub recovery
{
my $self = shift; # Class hash
+ # Assign function parameters, defaults, and log debug info
+ my ($strOperation) = logDebugParam (OP_RESTORE_RECOVERY);
+
# Create recovery.conf path/file
my $strRecoveryConf = $self->{strDbClusterPath} . '/' . FILE_RECOVERY_CONF;
@@ -492,103 +561,109 @@ sub recovery
my $bRecoveryConfExists = $self->{oFile}->exists(PATH_DB_ABSOLUTE, $strRecoveryConf);
# If RECOVERY_TYPE_PRESERVE then warn if recovery.conf does not exist and return
- if ($self->{strType} eq RECOVERY_TYPE_PRESERVE)
+ if (optionTest(OPTION_TYPE, RECOVERY_TYPE_PRESERVE))
{
if (!$bRecoveryConfExists)
{
- &log(WARN, "recovery type is $self->{strType} but recovery file does not exist at ${strRecoveryConf}");
+ &log(WARN, "recovery type is " . optionGet(OPTION_TYPE) . " but recovery file does not exist at ${strRecoveryConf}");
+ }
+ }
+ else
+ {
+ # In all other cases the old recovery.conf should be removed if it exists
+ if ($bRecoveryConfExists)
+ {
+ $self->{oFile}->remove(PATH_DB_ABSOLUTE, $strRecoveryConf);
}
- return;
- }
-
- # In all other cases the old recovery.conf should be removed if it exists
- if ($bRecoveryConfExists)
- {
- $self->{oFile}->remove(PATH_DB_ABSOLUTE, $strRecoveryConf);
- }
-
- # If RECOVERY_TYPE_NONE then return
- if ($self->{strType} eq RECOVERY_TYPE_NONE)
- {
- return;
- }
-
- # Write recovery options read from the configuration file
- my $strRecovery = '';
- my $bRestoreCommandOverride = false;
-
- if (defined($self->{oRecoveryRef}))
- {
- foreach my $strKey (sort(keys(%{$self->{oRecoveryRef}})))
+ # If RECOVERY_TYPE_NONE then return
+ if (!optionTest(OPTION_TYPE, RECOVERY_TYPE_NONE))
{
- my $strPgKey = $strKey;
- $strPgKey =~ s/\-/\_/g;
+ # Write recovery options read from the configuration file
+ my $strRecovery = '';
+ my $bRestoreCommandOverride = false;
- if ($strPgKey eq 'restore_command')
+ if (optionTest(OPTION_RESTORE_RECOVERY_SETTING))
{
- $bRestoreCommandOverride = true;
+ my $oRecoveryRef = optionGet(OPTION_RESTORE_RECOVERY_SETTING);
+
+ foreach my $strKey (sort(keys(%$oRecoveryRef)))
+ {
+ my $strPgKey = $strKey;
+ $strPgKey =~ s/\-/\_/g;
+
+ if ($strPgKey eq 'restore_command')
+ {
+ $bRestoreCommandOverride = true;
+ }
+
+ $strRecovery .= "${strPgKey} = '$$oRecoveryRef{$strKey}'\n";
+ }
}
- $strRecovery .= "$strPgKey = '${$self->{oRecoveryRef}}{$strKey}'\n";
+ # Write the restore command
+ if (!$bRestoreCommandOverride)
+ {
+ $strRecovery .= "restore_command = '" . commandWrite(CMD_ARCHIVE_GET) . " %f \"%p\"'\n";
+ }
+
+ # If RECOVERY_TYPE_DEFAULT do not write target options
+ if (!optionTest(OPTION_TYPE, RECOVERY_TYPE_DEFAULT))
+ {
+ # Write the recovery target
+ $strRecovery .= "recovery_target_" . optionGet(OPTION_TYPE) . " = '" . optionGet(OPTION_TARGET) . "'\n";
+
+ # Write recovery_target_inclusive
+ if (optionGet(OPTION_TARGET_EXCLUSIVE, false))
+ {
+ $strRecovery .= "recovery_target_inclusive = 'false'\n";
+ }
+ }
+
+ # Write pause_at_recovery_target
+ if (optionGet(OPTION_TARGET_RESUME, false))
+ {
+ $strRecovery .= "pause_at_recovery_target = 'false'\n";
+ }
+
+ # Write recovery_target_timeline
+ if (optionTest(OPTION_TARGET_TIMELINE))
+ {
+ $strRecovery .= "recovery_target_timeline = '" . optionGet(OPTION_TARGET_TIMELINE) . "'\n";
+ }
+
+ # Write recovery.conf
+ my $hFile;
+
+ open($hFile, '>', $strRecoveryConf)
+ or confess &log(ERROR, "unable to open ${strRecoveryConf}: $!");
+
+ syswrite($hFile, $strRecovery)
+ or confess "unable to write section ${strRecoveryConf}: $!";
+
+ close($hFile)
+ or confess "unable to close ${strRecoveryConf}: $!";
+
+ &log(INFO, "wrote $strRecoveryConf");
}
}
- # Write the restore command
- if (!$bRestoreCommandOverride)
- {
- $strRecovery .= "restore_command = '" . commandWrite(CMD_ARCHIVE_GET) . " %f \"%p\"'\n";
- }
-
- # If RECOVERY_TYPE_DEFAULT do not write target options
- if ($self->{strType} ne RECOVERY_TYPE_DEFAULT)
- {
- # Write the recovery target
- $strRecovery .= "recovery_target_$self->{strType} = '$self->{strTarget}'\n";
-
- # Write recovery_target_inclusive
- if ($self->{bTargetExclusive})
- {
- $strRecovery .= "recovery_target_inclusive = 'false'\n";
- }
- }
-
- # Write pause_at_recovery_target
- if ($self->{bTargetResume})
- {
- $strRecovery .= "pause_at_recovery_target = 'false'\n";
- }
-
- # Write recovery_target_timeline
- if (defined($self->{strTargetTimeline}))
- {
- $strRecovery .= "recovery_target_timeline = '$self->{strTargetTimeline}'\n";
- }
-
- # Write recovery.conf
- my $hFile;
-
- open($hFile, '>', $strRecoveryConf)
- or confess &log(ERROR, "unable to open ${strRecoveryConf}: $!");
-
- syswrite($hFile, $strRecovery)
- or confess "unable to write section ${strRecoveryConf}: $!";
-
- close($hFile)
- or confess "unable to close ${strRecoveryConf}: $!";
-
- &log(INFO, "wrote $strRecoveryConf");
+ # Return from function and log return values if any
+ return logDebugReturn($strOperation);
}
####################################################################################################################################
-# RESTORE
+# process
#
# Takes a backup and restores it back to the original or a remapped location.
####################################################################################################################################
-sub restore
+sub process
{
my $self = shift; # Class hash
+ # Assign function parameters, defaults, and log debug info
+ my ($strOperation) = logDebugParam (OP_RESTORE_PROCESS);
+
# Make sure that Postgres is not running
if ($self->{oFile}->exists(PATH_DB_ABSOLUTE, $self->{strDbClusterPath} . '/' . FILE_POSTMASTER_PID))
{
@@ -596,10 +671,10 @@ sub restore
}
# Log the backup set to restore
- &log(INFO, "restore backup set " . $self->{strBackupPath});
+ &log(INFO, "restore backup set " . $self->{strBackupSet});
# Make sure the backup path is valid and load the manifest
- my $oManifest = $self->manifest_load();
+ my $oManifest = $self->manifestLoad();
# Delete pg_control file. This will be copied from the backup at the very end to prevent a partially restored database
# from being started by PostgreSQL.
@@ -614,8 +689,8 @@ sub restore
$self->build($oManifest);
# Get variables required for restore
- my $lCopyTimeBegin = $oManifest->getNumeric(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_TIMESTAMP_COPY_START);
- my $bSourceCompression = $oManifest->getBool(MANIFEST_SECTION_BACKUP_OPTION, MANIFEST_KEY_COMPRESS);
+ my $lCopyTimeBegin = $oManifest->numericGet(MANIFEST_SECTION_BACKUP, MANIFEST_KEY_TIMESTAMP_COPY_START);
+ my $bSourceCompression = $oManifest->boolGet(MANIFEST_SECTION_BACKUP_OPTION, MANIFEST_KEY_COMPRESS);
my $strCurrentUser = getpwuid($<);
my $strCurrentGroup = getgrgid($();
@@ -640,7 +715,7 @@ sub restore
next;
}
- my $lSize = $oManifest->getNumeric($strSection, $strFile, MANIFEST_SUBKEY_SIZE);
+ my $lSize = $oManifest->numericGet($strSection, $strFile, MANIFEST_SUBKEY_SIZE);
$lSizeTotal += $lSize;
# Preface the file key with the size. This allows for sorting the files to restore by size.
@@ -667,10 +742,10 @@ sub restore
$oRestoreHash{$strPathKey}{$strFileKey}{destination_path} =
$oManifest->get(MANIFEST_SECTION_BACKUP_PATH, $strPathKey, MANIFEST_SUBKEY_PATH);
$oRestoreHash{$strPathKey}{$strFileKey}{reference} =
- $oManifest->testBool(MANIFEST_SECTION_BACKUP_OPTION, MANIFEST_KEY_HARDLINK, undef, true) ? undef :
+ $oManifest->boolTest(MANIFEST_SECTION_BACKUP_OPTION, MANIFEST_KEY_HARDLINK, undef, true) ? undef :
$oManifest->get($strSection, $strFile, MANIFEST_SUBKEY_REFERENCE, false);
$oRestoreHash{$strPathKey}{$strFileKey}{modification_time} =
- $oManifest->getNumeric($strSection, $strFile, MANIFEST_SUBKEY_TIMESTAMP);
+ $oManifest->numericGet($strSection, $strFile, MANIFEST_SUBKEY_TIMESTAMP);
$oRestoreHash{$strPathKey}{$strFileKey}{mode} =
$oManifest->get($strSection, $strFile, MANIFEST_SUBKEY_MODE);
$oRestoreHash{$strPathKey}{$strFileKey}{user} =
@@ -689,9 +764,13 @@ sub restore
}
# If multi-threaded then create threads to copy files
- if ($self->{iThreadTotal} > 1)
+ if (optionGet(OPTION_THREAD_MAX) > 1)
{
- &log(DEBUG, "starting restore with $self->{iThreadTotal} threads");
+ logDebugMisc
+ (
+ $strOperation, 'restore with threads',
+ {name => 'iThreadTotal', value => optionGet(OPTION_THREAD_MAX)}
+ );
# Initialize the thread queues
my @oyRestoreQueue;
@@ -714,16 +793,16 @@ sub restore
$oParam{copy_time_begin} = $lCopyTimeBegin;
$oParam{size_total} = $lSizeTotal;
- $oParam{delta} = $self->{bDelta};
- $oParam{force} = $self->{bForce};
- $oParam{backup_path} = $self->{strBackupPath};
+ $oParam{delta} = optionGet(OPTION_DELTA);
+ $oParam{force} = optionGet(OPTION_FORCE);
+ $oParam{backup_path} = $self->{strBackupSet};
$oParam{source_compression} = $bSourceCompression;
$oParam{current_user} = $strCurrentUser;
$oParam{current_group} = $strCurrentGroup;
$oParam{queue} = \@oyRestoreQueue;
# Run the threads
- for (my $iThreadIdx = 0; $iThreadIdx < $self->{iThreadTotal}; $iThreadIdx++)
+ for (my $iThreadIdx = 0; $iThreadIdx < optionGet(OPTION_THREAD_MAX); $iThreadIdx++)
{
threadGroupRun($iThreadIdx, 'restore', \%oParam);
}
@@ -733,7 +812,7 @@ sub restore
}
else
{
- &log(DEBUG, "starting restore in main process");
+ logDebugMisc($strOperation, 'restore in main process');
# Restore file in main process
foreach my $strPathKey (sort (keys %oRestoreHash))
@@ -743,8 +822,8 @@ sub restore
# Skip files marked to be copied later
next if ($oRestoreHash{$strPathKey}{$strFileKey}{skip});
- $lSizeCurrent = restoreFile($oRestoreHash{$strPathKey}{$strFileKey}, $lCopyTimeBegin, $self->{bDelta},
- $self->{bForce}, $self->{strBackupPath}, $bSourceCompression, $strCurrentUser,
+ $lSizeCurrent = restoreFile($oRestoreHash{$strPathKey}{$strFileKey}, $lCopyTimeBegin, optionGet(OPTION_DELTA),
+ optionGet(OPTION_FORCE), $self->{strBackupSet}, $bSourceCompression, $strCurrentUser,
$strCurrentGroup, $self->{oFile}, $lSizeTotal, $lSizeCurrent);
}
}
@@ -756,11 +835,12 @@ sub restore
# Copy pg_control last
&log(INFO, 'restore ' . FILE_PG_CONTROL . ' (copied last to ensure aborted restores cannot be started)');
- restoreFile($oRestoreHash{&MANIFEST_KEY_BASE}{&FILE_PG_CONTROL}, $lCopyTimeBegin, $self->{bDelta}, $self->{bForce},
- $self->{strBackupPath}, $bSourceCompression, $strCurrentUser, $strCurrentGroup, $self->{oFile}, $lSizeTotal,
- $lSizeCurrent);
+ restoreFile($oRestoreHash{&MANIFEST_KEY_BASE}{&FILE_PG_CONTROL}, $lCopyTimeBegin, optionGet(OPTION_DELTA),
+ optionGet(OPTION_FORCE), $self->{strBackupSet}, $bSourceCompression, $strCurrentUser, $strCurrentGroup,
+ $self->{oFile}, $lSizeTotal, $lSizeCurrent);
- &log(INFO, 'restore complete');
+ # Return from function and log return values if any
+ return logDebugReturn($strOperation);
}
1;
diff --git a/lib/BackRest/RestoreFile.pm b/lib/BackRest/RestoreFile.pm
index b3d99b43b..75d726047 100644
--- a/lib/BackRest/RestoreFile.pm
+++ b/lib/BackRest/RestoreFile.pm
@@ -11,15 +11,24 @@ use warnings FATAL => qw(all);
use Carp qw(confess);
use Exporter qw(import);
+ our @EXPORT = qw();
use File::Basename qw(dirname);
use File::stat qw(lstat);
use lib dirname($0);
+use BackRest::Common::Exception;
+use BackRest::Common::Log;
+use BackRest::Common::String;
use BackRest::Config;
-use BackRest::Exception;
use BackRest::File;
use BackRest::Manifest;
-use BackRest::Utility;
+
+####################################################################################################################################
+# Operation constants
+####################################################################################################################################
+use constant OP_RESTORE_FILE => 'RestoreFile';
+
+use constant OP_RESTORE_FILE_RESTORE_FILE => OP_RESTORE_FILE . '::restoreFile';
####################################################################################################################################
# restoreFile
@@ -29,19 +38,39 @@ use BackRest::Utility;
sub restoreFile
{
my $oFileHash = shift; # File to restore
- my $lCopyTimeBegin = shift; # Time that the backup begain - used for size/timestamp deltas
- my $bDelta = shift; # Is restore a delta?
- my $bForce = shift; # Force flag
- my $strBackupPath = shift; # Backup path
- my $bSourceCompression = shift; # Is the source compressed?
- my $strCurrentUser = shift; # Current OS user
- my $strCurrentGroup = shift; # Current OS group
- my $oFile = shift; # File object
- my $lSizeTotal = shift; # Total size of files to be restored
- my $lSizeCurrent = shift; # Current size of files restored
+
+ # Assign function parameters, defaults, and log debug info
+ my
+ (
+ $strOperation,
+ $lCopyTimeBegin, # Time that the backup begain - used for size/timestamp deltas
+ $bDelta, # Is restore a delta?
+ $bForce, # Force flag
+ $strBackupPath, # Backup path
+ $bSourceCompression, # Is the source compressed?
+ $strCurrentUser, # Current OS user
+ $strCurrentGroup, # Current OS group
+ $oFile, # File object
+ $lSizeTotal, # Total size of files to be restored
+ $lSizeCurrent # Current size of files restored
+ ) =
+ logDebugParam
+ (
+ OP_RESTORE_FILE_RESTORE_FILE, \@_,
+ {name => 'lCopyTimeBegin', trace => true},
+ {name => 'bDelta', trace => true},
+ {name => 'bForce', trace => true},
+ {name => 'strBackupPath', trace => true},
+ {name => 'bSourceCompression', trace => true},
+ {name => 'strCurrentUser', trace => true},
+ {name => 'strCurrentGroup', trace => true},
+ {name => 'oFile', trace => true},
+ {name => 'lSizeTotal', trace => true},
+ {name => 'lSizeCurrent', trace => true}
+ );
# Generate destination file name
- my $strDestinationFile = $oFile->path_get(PATH_DB_ABSOLUTE, "$$oFileHash{destination_path}/$$oFileHash{file}");
+ my $strDestinationFile = $oFile->pathGet(PATH_DB_ABSOLUTE, "$$oFileHash{destination_path}/$$oFileHash{file}");
# Copy flag and log message
my $bCopy = true;
@@ -62,18 +91,17 @@ sub restoreFile
if (defined($oStat) && $oStat->size == $$oFileHash{size} &&
$oStat->mtime == $$oFileHash{modification_time} && $oStat->mtime < $lCopyTimeBegin)
{
- $strLog = "${strDestinationFile} exists and matches size " . $oStat->size .
- " and modification time " . $oStat->mtime;
+ $strLog = 'exists and matches size ' . $oStat->size . ' and modification time ' . $oStat->mtime;
$bCopy = false;
}
}
else
{
- my ($strChecksum, $lSize) = $oFile->hash_size(PATH_DB_ABSOLUTE, $strDestinationFile);
+ my ($strChecksum, $lSize) = $oFile->hashSize(PATH_DB_ABSOLUTE, $strDestinationFile);
if ($lSize == $$oFileHash{size} && ($lSize == 0 || $strChecksum eq $$oFileHash{checksum}))
{
- $strLog = "exists and " . ($lSize == 0 ? 'is zero size' : "matches backup");
+ $strLog = 'exists and ' . ($lSize == 0 ? 'is zero size' : "matches backup");
# Even if hash is the same set the time back to backup time. This helps with unit testing, but also
# presents a pristine version of the database after restore.
@@ -107,17 +135,21 @@ sub restoreFile
confess &log(ERROR, "error restoring ${strDestinationFile}: actual checksum ${strCopyChecksum} " .
"does not match expected checksum $$oFileHash{checksum}", ERROR_CHECKSUM);
}
-
- $strLog = "restore";
}
- &log(INFO, "${strDestinationFile} ${strLog} (" . file_size_format($$oFileHash{size}) .
+ &log(INFO, "restore file ${strDestinationFile}" . (defined($strLog) ? " - ${strLog}" : '') .
+ ' (' . fileSizeFormat($$oFileHash{size}) .
($lSizeTotal > 0 ? ', ' . int($lSizeCurrent * 100 / $lSizeTotal) . '%' : '') . ')' .
($$oFileHash{size} != 0 ? " checksum $$oFileHash{checksum}" : ''));
- return $lSizeCurrent;
+ # Return from function and log return values if any
+ return logDebugReturn
+ (
+ $strOperation,
+ {name => 'lSizeCurrent', value => $lSizeCurrent, trace => true}
+ );
}
-our @EXPORT = qw(restoreFile);
+push @EXPORT, qw(restoreFile);
1;
diff --git a/lib/BackRest/Version.pm b/lib/BackRest/Version.pm
index c14ffeb10..37abf7c74 100644
--- a/lib/BackRest/Version.pm
+++ b/lib/BackRest/Version.pm
@@ -9,6 +9,7 @@ use strict;
use warnings FATAL => qw(all);
use Exporter qw(import);
+ our @EXPORT = qw();
# BackRest Version Number
#
@@ -18,7 +19,7 @@ use Exporter qw(import);
our # 'our' keyword is on a separate line to make the ExtUtils::MakeMaker parser happy.
$VERSION = '0.85';
-our @EXPORT = qw($VERSION);
+push @EXPORT, qw($VERSION);
# Format Format Number
#
diff --git a/test/lib/BackRestTest/BackupCommonTest.pm b/test/lib/BackRestTest/BackupCommonTest.pm
index 75eb5c85a..6d7f3dc84 100644
--- a/test/lib/BackRestTest/BackupCommonTest.pm
+++ b/test/lib/BackRestTest/BackupCommonTest.pm
@@ -22,12 +22,13 @@ use Time::HiRes qw(gettimeofday);
use lib dirname($0) . '/../lib';
use BackRest::Archive;
use BackRest::ArchiveInfo;
+use BackRest::Common::Exception;
+use BackRest::Common::Ini;
+use BackRest::Common::Log;
+use BackRest::Common::Wait;
use BackRest::Config;
-use BackRest::Exception;
use BackRest::File;
-use BackRest::Ini;
use BackRest::Manifest;
-use BackRest::Utility;
use BackRestTest::CommonTest;
@@ -1092,7 +1093,7 @@ sub BackRestTestBackup_BackupCompare
}
my %oActualManifest;
- iniLoad($oFile->path_get(PATH_BACKUP_CLUSTER, $strBackup) . '/' . FILE_MANIFEST, \%oActualManifest);
+ iniLoad($oFile->pathGet(PATH_BACKUP_CLUSTER, $strBackup) . '/' . FILE_MANIFEST, \%oActualManifest);
${$oExpectedManifestRef}{&MANIFEST_SECTION_BACKUP}{&MANIFEST_KEY_TIMESTAMP_START} =
$oActualManifest{&MANIFEST_SECTION_BACKUP}{&MANIFEST_KEY_TIMESTAMP_START};
@@ -1149,12 +1150,12 @@ sub BackRestTestBackup_ManifestMunge
if ($bRemote)
{
BackRestTestCommon_Execute('chmod 750 ' . BackRestTestCommon_RepoPathGet(), true);
- BackRestTestCommon_Execute('chmod 770 ' . $oFile->path_get(PATH_BACKUP_CLUSTER, $strBackup) . '/' . FILE_MANIFEST, true);
+ BackRestTestCommon_Execute('chmod 770 ' . $oFile->pathGet(PATH_BACKUP_CLUSTER, $strBackup) . '/' . FILE_MANIFEST, true);
}
# Read the manifest
my %oManifest;
- iniLoad($oFile->path_get(PATH_BACKUP_CLUSTER, $strBackup) . '/' . FILE_MANIFEST, \%oManifest);
+ iniLoad($oFile->pathGet(PATH_BACKUP_CLUSTER, $strBackup) . '/' . FILE_MANIFEST, \%oManifest);
# Write in the munged value
if (defined($strSubKey))
@@ -1191,12 +1192,12 @@ sub BackRestTestBackup_ManifestMunge
$oManifest{&INI_SECTION_BACKREST}{&INI_KEY_CHECKSUM} = $oSHA->hexdigest();
# Resave the manifest
- iniSave($oFile->path_get(PATH_BACKUP_CLUSTER, $strBackup) . '/' . FILE_MANIFEST, \%oManifest);
+ iniSave($oFile->pathGet(PATH_BACKUP_CLUSTER, $strBackup) . '/' . FILE_MANIFEST, \%oManifest);
# Change mode on the backup path back before unit tests continue
if ($bRemote)
{
- BackRestTestCommon_Execute('chmod 750 ' . $oFile->path_get(PATH_BACKUP_CLUSTER, $strBackup) . '/' . FILE_MANIFEST, true);
+ BackRestTestCommon_Execute('chmod 750 ' . $oFile->pathGet(PATH_BACKUP_CLUSTER, $strBackup) . '/' . FILE_MANIFEST, true);
BackRestTestCommon_Execute('chmod 700 ' . BackRestTestCommon_RepoPathGet(), true);
}
}
@@ -1418,11 +1419,11 @@ sub BackRestTestBackup_RestoreCompare
$oActualManifest->set(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_DB_VERSION, undef,
${$oExpectedManifestRef}{&MANIFEST_SECTION_BACKUP_DB}{&MANIFEST_KEY_DB_VERSION});
- $oActualManifest->setNumeric(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_CONTROL, undef,
+ $oActualManifest->numericSet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_CONTROL, undef,
${$oExpectedManifestRef}{&MANIFEST_SECTION_BACKUP_DB}{&MANIFEST_KEY_CONTROL});
- $oActualManifest->setNumeric(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_CATALOG, undef,
+ $oActualManifest->numericSet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_CATALOG, undef,
${$oExpectedManifestRef}{&MANIFEST_SECTION_BACKUP_DB}{&MANIFEST_KEY_CATALOG});
- $oActualManifest->setNumeric(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_SYSTEM_ID, undef,
+ $oActualManifest->numericSet(MANIFEST_SECTION_BACKUP_DB, MANIFEST_KEY_SYSTEM_ID, undef,
${$oExpectedManifestRef}{&MANIFEST_SECTION_BACKUP_DB}{&MANIFEST_KEY_SYSTEM_ID});
$oActualManifest->set(INI_SECTION_BACKREST, INI_KEY_VERSION, undef,
diff --git a/test/lib/BackRestTest/BackupTest.pm b/test/lib/BackRestTest/BackupTest.pm
index 256276534..ac3cc7fe5 100755
--- a/test/lib/BackRestTest/BackupTest.pm
+++ b/test/lib/BackRestTest/BackupTest.pm
@@ -22,15 +22,16 @@ use Time::HiRes qw(gettimeofday);
use lib dirname($0) . '/../lib';
use BackRest::Archive;
use BackRest::ArchiveInfo;
+use BackRest::Common::Exception;
+use BackRest::Common::Ini;
+use BackRest::Common::Log;
+use BackRest::Common::Wait;
use BackRest::Db;
use BackRest::Config;
-use BackRest::Exception;
use BackRest::File;
-use BackRest::Ini;
use BackRest::Manifest;
use BackRest::Protocol::Common;
use BackRest::Protocol::RemoteMaster;
-use BackRest::Utility;
use BackRestTest::BackupCommonTest;
use BackRestTest::CommonTest;
@@ -188,7 +189,7 @@ sub BackRestTestBackup_Test
if ($iArchive == $iBackup)
{
# load the archive info file so it can be munged for testing
- my $strInfoFile = $oFile->path_get(PATH_BACKUP_ARCHIVE, ARCHIVE_INFO_FILE);
+ my $strInfoFile = $oFile->pathGet(PATH_BACKUP_ARCHIVE, ARCHIVE_INFO_FILE);
my %oInfo;
BackRestTestCommon_iniLoad($strInfoFile, \%oInfo, $bRemote);
my $strDbVersion = $oInfo{&INFO_ARCHIVE_SECTION_DB}{&INFO_ARCHIVE_KEY_DB_VERSION};
@@ -272,7 +273,7 @@ sub BackRestTestBackup_Test
# !!! Need to put in tests for .backup files here
}
- BackRestTestCommon_TestLogAppendFile($oFile->path_get(PATH_BACKUP_ARCHIVE) . '/archive.info', $bRemote);
+ BackRestTestCommon_TestLogAppendFile($oFile->pathGet(PATH_BACKUP_ARCHIVE) . '/archive.info', $bRemote);
}
}
@@ -370,7 +371,7 @@ sub BackRestTestBackup_Test
archivePush($oFile, $strXlogPath, $strArchiveTestFile, 1);
# load the archive info file so it can be munged for testing
- my $strInfoFile = $oFile->path_get(PATH_BACKUP_ARCHIVE, ARCHIVE_INFO_FILE);
+ my $strInfoFile = $oFile->pathGet(PATH_BACKUP_ARCHIVE, ARCHIVE_INFO_FILE);
my %oInfo;
BackRestTestCommon_iniLoad($strInfoFile, \%oInfo, $bRemote);
my $strDbVersion = $oInfo{&INFO_ARCHIVE_SECTION_DB}{&INFO_ARCHIVE_KEY_DB_VERSION};
@@ -490,9 +491,9 @@ sub BackRestTestBackup_Test
BackRestTestCommon_Execute("chmod g+r,g+x " . BackRestTestCommon_RepoPathGet(), $bRemote);
}
- BackRestTestCommon_Execute('mkdir -p -m 770 ' . $oFile->path_get(PATH_BACKUP_ARCHIVE), $bRemote);
- (new BackRest::ArchiveInfo($oFile->path_get(PATH_BACKUP_ARCHIVE)))->check('9.3', 1234567890123456789);
- BackRestTestCommon_TestLogAppendFile($oFile->path_get(PATH_BACKUP_ARCHIVE) . '/archive.info', $bRemote);
+ BackRestTestCommon_Execute('mkdir -p -m 770 ' . $oFile->pathGet(PATH_BACKUP_ARCHIVE), $bRemote);
+ (new BackRest::ArchiveInfo($oFile->pathGet(PATH_BACKUP_ARCHIVE)))->check('9.3', 1234567890123456789);
+ BackRestTestCommon_TestLogAppendFile($oFile->pathGet(PATH_BACKUP_ARCHIVE) . '/archive.info', $bRemote);
if ($bRemote)
{
@@ -646,7 +647,7 @@ sub BackRestTestBackup_Test
"/backup/${strStanza}/backup.info", false);
# Create an archive log path that will be removed as old on the first archive expire call
- $oFile->path_create(PATH_BACKUP_ARCHIVE, BackRestTestCommon_DbVersion() . '-1/0000000000000000');
+ $oFile->pathCreate(PATH_BACKUP_ARCHIVE, BackRestTestCommon_DbVersion() . '-1/0000000000000000');
# Get the expected archive list
my @stryArchiveExpected = $oFile->list(PATH_BACKUP_ARCHIVE, BackRestTestCommon_DbVersion() . '-1/0000000100000000');
@@ -922,6 +923,8 @@ sub BackRestTestBackup_Test
'add tablespace 1');
# Resume Incr Backup
+ #
+ # Links are removed in the resume because it's easy to recreate them.
#-----------------------------------------------------------------------------------------------------------------------
$strType = 'incr';
@@ -1626,7 +1629,7 @@ sub BackRestTestBackup_Test
# Sleep .5 seconds to give a reasonable amount of time for the file to be copied after the manifest was generated
# Sleep for a while to show there is a large window where this can happen
&log(INFO, 'time ' . gettimeofday());
- hsleep(.5);
+ waitHiRes(.5);
&log(INFO, 'time ' . gettimeofday());
# Insert another row
@@ -1718,7 +1721,7 @@ sub BackRestTestBackup_Test
# Sleep for a while to show there is a large window where this can happen
&log(INFO, 'time ' . gettimeofday());
- hsleep(.5);
+ waitHiRes(.5);
&log(INFO, 'time ' . gettimeofday());
# Modify the test file within the same second
diff --git a/test/lib/BackRestTest/CommonTest.pm b/test/lib/BackRestTest/CommonTest.pm
index 50dd9e712..dfb716ba1 100755
--- a/test/lib/BackRestTest/CommonTest.pm
+++ b/test/lib/BackRestTest/CommonTest.pm
@@ -21,12 +21,14 @@ use IPC::Open3;
use POSIX ':sys_wait_h';
use lib dirname($0) . '/../lib';
+use BackRest::Common::Ini;
+use BackRest::Common::Log;
+use BackRest::Common::String;
+use BackRest::Common::Wait;
use BackRest::Config;
use BackRest::Db;
use BackRest::File;
-use BackRest::Ini;
use BackRest::Manifest;
-use BackRest::Utility;
our @EXPORT = qw(BackRestTestCommon_Create BackRestTestCommon_Drop BackRestTestCommon_Setup BackRestTestCommon_ExecuteBegin
BackRestTestCommon_ExecuteEnd BackRestTestCommon_Execute BackRestTestCommon_ExecuteBackRest
@@ -119,7 +121,7 @@ sub BackRestTestCommon_DropRepo
{
BackRestTestCommon_PathRemove(BackRestTestCommon_RepoPathGet(), true, true);
BackRestTestCommon_PathRemove(BackRestTestCommon_RepoPathGet(), false, true);
- hsleep(.1);
+ waitHiRes(.1);
}
}
@@ -322,7 +324,8 @@ sub BackRestTestCommon_ExecuteBegin
$bFullLog = false;
- if (defined($strModule) && $strCommandParam =~ /^$strCommonCommandMain/)
+ if (defined($strModule) &&
+ ($strCommandParam =~ /$strCommonCommandMain/ || $strCommandParam =~ /$strCommonCommandRemote/))
{
$strCommandParam = BackRestTestCommon_ExecuteRegExpAll($strCommandParam);
@@ -423,6 +426,7 @@ sub BackRestTestCommon_ExecuteRegExpAll
my $strBinPath = dirname(dirname(abs_path($0))) . '/bin';
$strLine =~ s/$strCommonCommandMain/[BACKREST_BIN]/g;
+ $strLine =~ s/$strCommonCommandRemote/[BACKREST_BIN]/g;
$strLine =~ s/$strPgSqlBin/[PGSQL_BIN_PATH]/g;
my $strTestPath = BackRestTestCommon_TestPathGet();
@@ -432,16 +436,16 @@ sub BackRestTestCommon_ExecuteRegExpAll
$strLine =~ s/$strTestPath/[TEST_PATH]/g;
}
- $strLine = BackRestTestCommon_ExecuteRegExp($strLine, 'MODIFICATION-TIME', 'modification_time = [0-9]+', '[0-9]+$');
+ $strLine = BackRestTestCommon_ExecuteRegExp($strLine, 'MODIFICATION-TIME', 'lModificationTime = [0-9]+', '[0-9]+$');
$strLine = BackRestTestCommon_ExecuteRegExp($strLine, 'TIMESTAMP', 'timestamp"[ ]{0,1}:[ ]{0,1}[0-9]+','[0-9]+$');
$strLine = BackRestTestCommon_ExecuteRegExp($strLine, 'BACKUP-INCR', '[0-9]{8}\-[0-9]{6}F\_[0-9]{8}\-[0-9]{6}I');
$strLine = BackRestTestCommon_ExecuteRegExp($strLine, 'BACKUP-DIFF', '[0-9]{8}\-[0-9]{6}F\_[0-9]{8}\-[0-9]{6}D');
$strLine = BackRestTestCommon_ExecuteRegExp($strLine, 'BACKUP-FULL', '[0-9]{8}\-[0-9]{6}F');
- $strLine = BackRestTestCommon_ExecuteRegExp($strLine, 'GROUP', 'group = [^ \n,\[\]]+', '[^ \n,\[\]]+$');
+ $strLine = BackRestTestCommon_ExecuteRegExp($strLine, 'GROUP', 'strGroup = [^ \n,\[\]]+', '[^ \n,\[\]]+$');
$strLine = BackRestTestCommon_ExecuteRegExp($strLine, 'GROUP', 'group"[ ]{0,1}:[ ]{0,1}"[^"]+', '[^"]+$');
- $strLine = BackRestTestCommon_ExecuteRegExp($strLine, 'USER', 'user = [^ \n,\[\]]+', '[^ \n,\[\]]+$');
+ $strLine = BackRestTestCommon_ExecuteRegExp($strLine, 'USER', 'strUser = [^ \n,\[\]]+', '[^ \n,\[\]]+$');
$strLine = BackRestTestCommon_ExecuteRegExp($strLine, 'USER', 'user"[ ]{0,1}:[ ]{0,1}"[^"]+', '[^"]+$');
$strLine = BackRestTestCommon_ExecuteRegExp($strLine, 'USER', '^db-user=.+$', '[^=]+$');
@@ -516,7 +520,7 @@ sub BackRestTestCommon_ExecuteEnd
{
$strOutLog .= $strLine;
- if (defined($strTest) && test_check($strLine, $strTest))
+ if (defined($strTest) && testCheck($strLine, $strTest))
{
&log(DEBUG, "Found test ${strTest}");
return true;
@@ -807,11 +811,11 @@ sub BackRestTestCommon_Setup
}
# Don't run unit tests for unsupported versions
- my $strVersionSupport = versionSupport();
+ my @stryVersionSupport = versionSupport();
- if ($strCommonDbVersion < ${$strVersionSupport}[0])
+ if ($strCommonDbVersion < $stryVersionSupport[0])
{
- confess "currently only version ${$strVersionSupport}[0] and up are supported";
+ confess "currently only version $stryVersionSupport[0] and up are supported";
}
return true;
diff --git a/test/lib/BackRestTest/CompareTest.pm b/test/lib/BackRestTest/CompareTest.pm
index cf22bc1af..63eeaef97 100755
--- a/test/lib/BackRestTest/CompareTest.pm
+++ b/test/lib/BackRestTest/CompareTest.pm
@@ -17,7 +17,7 @@ use File::stat;
use Time::HiRes qw(gettimeofday);
use lib dirname($0) . '/../lib';
-use BackRest::Utility;
+use BackRest::Common::Log;
use BackRestTest::BackupTest;
use BackRestTest::CommonTest;
@@ -35,7 +35,7 @@ sub BackRestTestCompare_BuildDb
my $iTableTotal = shift;
my $iTableSize = shift;
- &log(INFO, "build database: " . file_size_format($iTableTotal * $iTableSize * 1024 * 1024));
+ &log(INFO, "build database: " . fileSizeFormat($iTableTotal * $iTableSize * 1024 * 1024));
for (my $iTableIdx = 0; $iTableIdx < $iTableTotal; $iTableIdx++)
{
diff --git a/test/lib/BackRestTest/ConfigTest.pm b/test/lib/BackRestTest/ConfigTest.pm
index a0b215bbf..d8d78d37b 100755
--- a/test/lib/BackRestTest/ConfigTest.pm
+++ b/test/lib/BackRestTest/ConfigTest.pm
@@ -17,10 +17,10 @@ use File::Basename qw(dirname);
use Scalar::Util qw(blessed);
use lib dirname($0) . '/../lib';
+use BackRest::Common::Exception;
+use BackRest::Common::Ini;
+use BackRest::Common::Log;
use BackRest::Config;
-use BackRest::Exception;
-use BackRest::Ini;
-use BackRest::Utility;
use BackRestTest::CommonTest;
@@ -33,7 +33,7 @@ sub optionSetTest
$$oOption{option}{$strKey} = $strValue;
}
-sub optionSetBoolTest
+sub optionboolSetTest
{
my $oOption = shift;
my $strKey = shift;
@@ -123,7 +123,7 @@ sub configLoadExpect
my $oMessage = $@;
- if (blessed($oMessage) && $oMessage->isa('BackRest::Exception'))
+ if (blessed($oMessage) && $oMessage->isa('BackRest::Common::Exception'))
{
if ($oMessage->code() != $iExpectedError)
{
@@ -184,7 +184,7 @@ sub configLoadExpect
}
else
{
- confess "configLoad should throw BackRest::Exception:\n$oMessage";
+ confess "configLoad should throw BackRest::Common::Exception:\n$oMessage";
}
}
else
@@ -273,7 +273,7 @@ sub BackRestTestConfig_Test
if (BackRestTestCommon_Run(++$iRun, 'backup with boolean stanza'))
{
- optionSetBoolTest($oOption, OPTION_STANZA);
+ optionboolSetTest($oOption, OPTION_STANZA);
configLoadExpect($oOption, CMD_BACKUP, ERROR_COMMAND_REQUIRED);
}
@@ -310,7 +310,7 @@ sub BackRestTestConfig_Test
{
optionSetTest($oOption, OPTION_STANZA, $strStanza);
optionSetTest($oOption, OPTION_DB_PATH, '/db');
- optionSetBoolTest($oOption, OPTION_FORCE);
+ optionboolSetTest($oOption, OPTION_FORCE);
configLoadExpect($oOption, CMD_BACKUP, ERROR_OPTION_INVALID, OPTION_FORCE, OPTION_NO_START_STOP);
}
@@ -320,8 +320,8 @@ sub BackRestTestConfig_Test
# $oOption = {};
optionSetTest($oOption, OPTION_STANZA, $strStanza);
optionSetTest($oOption, OPTION_DB_PATH, '/db');
- optionSetBoolTest($oOption, OPTION_NO_START_STOP);
- optionSetBoolTest($oOption, OPTION_FORCE);
+ optionboolSetTest($oOption, OPTION_NO_START_STOP);
+ optionboolSetTest($oOption, OPTION_FORCE);
configLoadExpect($oOption, CMD_BACKUP);
optionTestExpect(OPTION_NO_START_STOP, true);
@@ -332,7 +332,7 @@ sub BackRestTestConfig_Test
{
optionSetTest($oOption, OPTION_STANZA, $strStanza);
optionSetTest($oOption, OPTION_DB_PATH, '/db');
- optionSetBoolTest($oOption, OPTION_TEST);
+ optionboolSetTest($oOption, OPTION_TEST);
optionSetTest($oOption, OPTION_TEST_DELAY, BOGUS);
configLoadExpect($oOption, CMD_BACKUP, ERROR_OPTION_INVALID_VALUE, BOGUS, OPTION_TEST_DELAY);
@@ -409,7 +409,7 @@ sub BackRestTestConfig_Test
{
optionSetTest($oOption, OPTION_STANZA, $strStanza);
optionSetTest($oOption, OPTION_DB_PATH, '/db');
- optionSetBoolTest($oOption, OPTION_TEST);
+ optionboolSetTest($oOption, OPTION_TEST);
optionSetTest($oOption, OPTION_TEST_DELAY, '0.25');
configLoadExpect($oOption, CMD_BACKUP);
@@ -419,7 +419,7 @@ sub BackRestTestConfig_Test
{
optionSetTest($oOption, OPTION_STANZA, $strStanza);
optionSetTest($oOption, OPTION_DB_PATH, '/db');
- optionSetBoolTest($oOption, OPTION_TEST);
+ optionboolSetTest($oOption, OPTION_TEST);
optionSetTest($oOption, OPTION_TEST_DELAY, 3);
configLoadExpect($oOption, CMD_BACKUP);
@@ -556,7 +556,7 @@ sub BackRestTestConfig_Test
optionSetTest($oOption, OPTION_STANZA, $strStanza);
optionSetTest($oOption, OPTION_DB_PATH, '/db');
optionSetTest($oOption, OPTION_CONFIG, '/dude/dude.conf');
- optionSetBoolTest($oOption, OPTION_CONFIG, false);
+ optionboolSetTest($oOption, OPTION_CONFIG, false);
configLoadExpect($oOption, CMD_BACKUP, ERROR_OPTION_NEGATE, OPTION_CONFIG);
}
@@ -565,7 +565,7 @@ sub BackRestTestConfig_Test
{
optionSetTest($oOption, OPTION_STANZA, $strStanza);
optionSetTest($oOption, OPTION_DB_PATH, '/db');
- optionSetBoolTest($oOption, OPTION_CONFIG, false);
+ optionboolSetTest($oOption, OPTION_CONFIG, false);
configLoadExpect($oOption, CMD_BACKUP);
optionTestExpect(OPTION_CONFIG);
diff --git a/test/lib/BackRestTest/FileTest.pm b/test/lib/BackRestTest/FileTest.pm
index d22328d5f..77f4e2fdb 100755
--- a/test/lib/BackRestTest/FileTest.pm
+++ b/test/lib/BackRestTest/FileTest.pm
@@ -21,11 +21,11 @@ use Scalar::Util qw(blessed);
use Time::HiRes qw(gettimeofday usleep);
use lib dirname($0) . '/../lib';
+use BackRest::Common::Log;
use BackRest::Config;
use BackRest::File;
use BackRest::Protocol::Common;
use BackRest::Protocol::RemoteMaster;
-use BackRest::Utility;
use BackRestTest::CommonTest;
@@ -121,7 +121,7 @@ sub BackRestTestFile_Test
{
$iRun = 0;
- &log(INFO, "Test File->path_create()\n");
+ &log(INFO, "Test File->pathCreate()\n");
# Loop through local/remote
for (my $bRemote = 0; $bRemote <= 1; $bRemote++)
@@ -175,7 +175,7 @@ sub BackRestTestFile_Test
eval
{
- $oFile->path_create($strPathType, $strPath, $strMode);
+ $oFile->pathCreate($strPathType, $strPath, $strMode);
};
# Check for errors
@@ -196,7 +196,7 @@ sub BackRestTestFile_Test
}
# Make sure the path was actually created
- my $strPathCheck = $oFile->path_get($strPathType, $strPath);
+ my $strPathCheck = $oFile->pathGet($strPathType, $strPath);
unless (-e $strPathCheck)
{
@@ -365,7 +365,7 @@ sub BackRestTestFile_Test
elsif ($bExists)
{
system("echo 'TESTDATA' > ${strFile}");
- ($strSourceHash, $iSourceSize) = $oFile->hash_size(PATH_BACKUP_ABSOLUTE, $strFile);
+ ($strSourceHash, $iSourceSize) = $oFile->hashSize(PATH_BACKUP_ABSOLUTE, $strFile);
}
# Execute in eval in case of error
@@ -403,7 +403,7 @@ sub BackRestTestFile_Test
system("gzip -d ${strDestinationFile}") == 0 or die "could not decompress ${strDestinationFile}";
- my ($strDestinationHash, $iDestinationSize) = $oFile->hash_size(PATH_BACKUP_ABSOLUTE, $strFile);
+ my ($strDestinationHash, $iDestinationSize) = $oFile->hashSize(PATH_BACKUP_ABSOLUTE, $strFile);
if ($strSourceHash ne $strDestinationHash)
{
@@ -918,7 +918,7 @@ sub BackRestTestFile_Test
eval
{
- ($strHash, $iSize) = $oFile->hash_size(PATH_BACKUP_ABSOLUTE, $strFile, $bCompressed)
+ ($strHash, $iSize) = $oFile->hashSize(PATH_BACKUP_ABSOLUTE, $strFile, $bCompressed)
};
if ($@)
@@ -1006,7 +1006,7 @@ sub BackRestTestFile_Test
if (blessed($oMessage))
{
- if ($oMessage->isa('BackRest::Exception'))
+ if ($oMessage->isa('BackRest::Common::Exception'))
{
$iCode = $oMessage->code();
$strMessage = $oMessage->message();
@@ -1203,7 +1203,7 @@ sub BackRestTestFile_Test
if (blessed($oMessage))
{
- if ($oMessage->isa('BackRest::Exception'))
+ if ($oMessage->isa('BackRest::Common::Exception'))
{
if ($bSourceMissing && !$bSourceIgnoreMissing)
{
@@ -1269,7 +1269,7 @@ sub BackRestTestFile_Test
or die "could not decompress ${strDestinationFile}";
}
- my ($strDestinationHash, $iDestinationSize) = $oFile->hash_size(PATH_ABSOLUTE, $strDestinationTest);
+ my ($strDestinationHash, $iDestinationSize) = $oFile->hashSize(PATH_ABSOLUTE, $strDestinationTest);
if ($strSourceHash ne $strDestinationHash || $strSourceHash ne $strCopyHash)
{
diff --git a/test/lib/BackRestTest/UtilityTest.pm b/test/lib/BackRestTest/IniTest.pm
similarity index 92%
rename from test/lib/BackRestTest/UtilityTest.pm
rename to test/lib/BackRestTest/IniTest.pm
index 782204393..1016ba988 100755
--- a/test/lib/BackRestTest/UtilityTest.pm
+++ b/test/lib/BackRestTest/IniTest.pm
@@ -1,8 +1,8 @@
#!/usr/bin/perl
####################################################################################################################################
-# UtilityTest.pl - Unit Tests for BackRest::Utility
+# IniTest.pm - Unit Tests for ini load and save
####################################################################################################################################
-package BackRestTest::UtilityTest;
+package BackRestTest::IniTest;
####################################################################################################################################
# Perl includes
@@ -15,19 +15,19 @@ use Exporter qw(import);
use File::Basename qw(dirname);
use lib dirname($0) . '/../lib';
+use BackRest::Common::Ini;
+use BackRest::Common::Log;
use BackRest::Config;
use BackRest::File;
-use BackRest::Ini;
-use BackRest::Utility;
use BackRestTest::CommonTest;
####################################################################################################################################
-# BackRestTestUtility_Test
+# BackRestTestIni_Test
####################################################################################################################################
-our @EXPORT = qw(BackRestTestUtility_Test);
+our @EXPORT = qw(BackRestTestIni_Test);
-sub BackRestTestUtility_Test
+sub BackRestTestIni_Test
{
my $strTest = shift;
@@ -37,7 +37,7 @@ sub BackRestTestUtility_Test
my $strTestPath = BackRestTestCommon_TestPathGet();
# Print test banner
- &log(INFO, 'UTILITY MODULE ******************************************************************');
+ &log(INFO, 'INI MODULE ******************************************************************');
#-------------------------------------------------------------------------------------------------------------------------------
# Create remote
diff --git a/test/log/backup-archive-get-001.log b/test/log/backup-archive-get-001.log
index 7d9b232a6..bb74c5340 100644
--- a/test/log/backup-archive-get-001.log
+++ b/test/log/backup-archive-get-001.log
@@ -3,12 +3,16 @@ run 001 - rmt 0, cmp 0, exists 0
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --stanza=db archive-get 000000010000000100000001 [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
------------------------------------------------------------------------------------------------------------------------------------
- INFO: getting WAL segment 000000010000000100000001
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
+ INFO: archive-get start: --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: get WAL segment 000000010000000100000001
+DEBUG: Archive->get(): strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strSourceArchive = 000000010000000100000001
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: ArchiveInfo->new(): bRequired = true, strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
ERROR: [130]: archive.info does not exist but is required to get WAL segments
HINT: Is archive_command configured in postgresql.conf?
HINT: Use --no-archive-check to disable archive checks during backup if you have an alternate archiving scheme.
-DEBUG: safe exit called, terminating threads
+DEBUG: Main::safeExit(): iExitCode = 130
+ INFO: archive-get stop
+ supplemental file: [TEST_PATH]/backrest/archive/db/archive.info
-----------------------------------------------------------------
@@ -27,10 +31,18 @@ db-version="9.3"
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --stanza=db archive-get 000000090000000900000009 [TEST_PATH]/db/common/pg_xlog/RECOVERYXLOG
------------------------------------------------------------------------------------------------------------------------------------
- INFO: getting WAL segment 000000090000000900000009
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: Archive->getCheck=>: archiveId = 9.3-1
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000900000009, expression ^000000090000000900000009(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->exists: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000900000009
- INFO: 000000090000000900000009 was not found in the archive repository
-DEBUG: safe exit called, terminating threads
+ INFO: archive-get start: --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: get WAL segment 000000090000000900000009
+DEBUG: Archive->get(): strDestinationFile = [TEST_PATH]/db/common/pg_xlog/RECOVERYXLOG, strSourceArchive = 000000090000000900000009
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: ArchiveInfo->new(): bRequired = true, strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000090000000900000009
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000090000000900000009(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000900000009, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->exists(): strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000900000009, strPathType = backup:absolute
+DEBUG: File->exists=>: bExists = false
+DEBUG: Archive->walFileName=>: strWalFileName = [undef]
+ INFO: unable to find 000000090000000900000009 in the archive
+DEBUG: Archive->get=>: iResult = 1
+DEBUG: Main::safeExit(): iExitCode = 1
+ INFO: archive-get stop
diff --git a/test/log/backup-archive-get-002.log b/test/log/backup-archive-get-002.log
index cdcd07efc..4feae0e37 100644
--- a/test/log/backup-archive-get-002.log
+++ b/test/log/backup-archive-get-002.log
@@ -3,12 +3,16 @@ run 002 - rmt 0, cmp 0, exists 1
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --stanza=db archive-get 000000010000000100000001 [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
------------------------------------------------------------------------------------------------------------------------------------
- INFO: getting WAL segment 000000010000000100000001
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
+ INFO: archive-get start: --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: get WAL segment 000000010000000100000001
+DEBUG: Archive->get(): strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strSourceArchive = 000000010000000100000001
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: ArchiveInfo->new(): bRequired = true, strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
ERROR: [130]: archive.info does not exist but is required to get WAL segments
HINT: Is archive_command configured in postgresql.conf?
HINT: Use --no-archive-check to disable archive checks during backup if you have an alternate archiving scheme.
-DEBUG: safe exit called, terminating threads
+DEBUG: Main::safeExit(): iExitCode = 130
+ INFO: archive-get stop
+ supplemental file: [TEST_PATH]/backrest/archive/db/archive.info
-----------------------------------------------------------------
@@ -27,33 +31,54 @@ db-version="9.3"
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --stanza=db archive-get 000000010000000100000001 [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
------------------------------------------------------------------------------------------------------------------------------------
- INFO: getting WAL segment 000000010000000100000001
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: Archive->getCheck=>: archiveId = 9.3-1
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000001(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: archive_get: cp 000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031 [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
-DEBUG: File->copy: local backup:archive:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031 to local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000001, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = false, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000001.backrest.tmp to absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000001, destination_path_create = false
-DEBUG: safe exit called, terminating threads
+ INFO: archive-get start: --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: get WAL segment 000000010000000100000001
+DEBUG: Archive->get(): strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strSourceArchive = 000000010000000100000001
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: ArchiveInfo->new(): bRequired = true, strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000001
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000001(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = (000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031)
+DEBUG: Archive->walFileName=>: strWalFileName = 000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = false, bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = 9.3-1/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strSourcePathType = backup:archive, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001.backrest.tmp, strSourcePathType = absolute
+DEBUG: Archive->get=>: iResult = 0
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-get stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --stanza=db archive-get 000000010000000100000002 [TEST_PATH]/db/common/pg_xlog/000000010000000100000002
------------------------------------------------------------------------------------------------------------------------------------
- INFO: getting WAL segment 000000010000000100000002
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: Archive->getCheck=>: archiveId = 9.3-1
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000002(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: archive_get: cp 000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031 [TEST_PATH]/db/common/pg_xlog/000000010000000100000002
-DEBUG: File->copy: local backup:archive:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031 to local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000002, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = false, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000002.backrest.tmp to absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000002, destination_path_create = false
-DEBUG: safe exit called, terminating threads
+ INFO: archive-get start: --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: get WAL segment 000000010000000100000002
+DEBUG: Archive->get(): strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000002, strSourceArchive = 000000010000000100000002
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: ArchiveInfo->new(): bRequired = true, strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000002
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000002(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = (000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031)
+DEBUG: Archive->walFileName=>: strWalFileName = 000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = false, bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000002, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = 9.3-1/000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strSourcePathType = backup:archive, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000002, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000002.backrest.tmp, strSourcePathType = absolute
+DEBUG: Archive->get=>: iResult = 0
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-get stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --stanza=db archive-get 000000010000000100000003 [TEST_PATH]/db/common/pg_xlog/000000010000000100000003
------------------------------------------------------------------------------------------------------------------------------------
- INFO: getting WAL segment 000000010000000100000003
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: Archive->getCheck=>: archiveId = 9.3-1
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000003(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: archive_get: cp 000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031 [TEST_PATH]/db/common/pg_xlog/000000010000000100000003
-DEBUG: File->copy: local backup:archive:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031 to local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000003, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = false, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000003.backrest.tmp to absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000003, destination_path_create = false
-DEBUG: safe exit called, terminating threads
+ INFO: archive-get start: --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: get WAL segment 000000010000000100000003
+DEBUG: Archive->get(): strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000003, strSourceArchive = 000000010000000100000003
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: ArchiveInfo->new(): bRequired = true, strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000003
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000003(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = (000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031)
+DEBUG: Archive->walFileName=>: strWalFileName = 000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = false, bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000003, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = 9.3-1/000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strSourcePathType = backup:archive, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000003, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000003.backrest.tmp, strSourcePathType = absolute
+DEBUG: Archive->get=>: iResult = 0
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-get stop
diff --git a/test/log/backup-archive-get-003.log b/test/log/backup-archive-get-003.log
index 6fdb646ca..81f3769c4 100644
--- a/test/log/backup-archive-get-003.log
+++ b/test/log/backup-archive-get-003.log
@@ -3,12 +3,16 @@ run 003 - rmt 0, cmp 1, exists 0
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --stanza=db archive-get 000000010000000100000001 [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
------------------------------------------------------------------------------------------------------------------------------------
- INFO: getting WAL segment 000000010000000100000001
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
+ INFO: archive-get start: --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: get WAL segment 000000010000000100000001
+DEBUG: Archive->get(): strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strSourceArchive = 000000010000000100000001
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: ArchiveInfo->new(): bRequired = true, strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
ERROR: [130]: archive.info does not exist but is required to get WAL segments
HINT: Is archive_command configured in postgresql.conf?
HINT: Use --no-archive-check to disable archive checks during backup if you have an alternate archiving scheme.
-DEBUG: safe exit called, terminating threads
+DEBUG: Main::safeExit(): iExitCode = 130
+ INFO: archive-get stop
+ supplemental file: [TEST_PATH]/backrest/archive/db/archive.info
-----------------------------------------------------------------
@@ -27,10 +31,18 @@ db-version="9.3"
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --stanza=db archive-get 000000090000000900000009 [TEST_PATH]/db/common/pg_xlog/RECOVERYXLOG
------------------------------------------------------------------------------------------------------------------------------------
- INFO: getting WAL segment 000000090000000900000009
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: Archive->getCheck=>: archiveId = 9.3-1
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000900000009, expression ^000000090000000900000009(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->exists: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000900000009
- INFO: 000000090000000900000009 was not found in the archive repository
-DEBUG: safe exit called, terminating threads
+ INFO: archive-get start: --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: get WAL segment 000000090000000900000009
+DEBUG: Archive->get(): strDestinationFile = [TEST_PATH]/db/common/pg_xlog/RECOVERYXLOG, strSourceArchive = 000000090000000900000009
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: ArchiveInfo->new(): bRequired = true, strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000090000000900000009
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000090000000900000009(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000900000009, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->exists(): strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000900000009, strPathType = backup:absolute
+DEBUG: File->exists=>: bExists = false
+DEBUG: Archive->walFileName=>: strWalFileName = [undef]
+ INFO: unable to find 000000090000000900000009 in the archive
+DEBUG: Archive->get=>: iResult = 1
+DEBUG: Main::safeExit(): iExitCode = 1
+ INFO: archive-get stop
diff --git a/test/log/backup-archive-get-004.log b/test/log/backup-archive-get-004.log
index 5ab284c9a..8e64aa4d3 100644
--- a/test/log/backup-archive-get-004.log
+++ b/test/log/backup-archive-get-004.log
@@ -3,12 +3,16 @@ run 004 - rmt 0, cmp 1, exists 1
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --stanza=db archive-get 000000010000000100000001 [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
------------------------------------------------------------------------------------------------------------------------------------
- INFO: getting WAL segment 000000010000000100000001
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
+ INFO: archive-get start: --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: get WAL segment 000000010000000100000001
+DEBUG: Archive->get(): strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strSourceArchive = 000000010000000100000001
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: ArchiveInfo->new(): bRequired = true, strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
ERROR: [130]: archive.info does not exist but is required to get WAL segments
HINT: Is archive_command configured in postgresql.conf?
HINT: Use --no-archive-check to disable archive checks during backup if you have an alternate archiving scheme.
-DEBUG: safe exit called, terminating threads
+DEBUG: Main::safeExit(): iExitCode = 130
+ INFO: archive-get stop
+ supplemental file: [TEST_PATH]/backrest/archive/db/archive.info
-----------------------------------------------------------------
@@ -27,33 +31,54 @@ db-version="9.3"
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --stanza=db archive-get 000000010000000100000001 [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
------------------------------------------------------------------------------------------------------------------------------------
- INFO: getting WAL segment 000000010000000100000001
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: Archive->getCheck=>: archiveId = 9.3-1
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000001(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: archive_get: cp 000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
-DEBUG: File->copy: local backup:archive:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz to local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000001, source_compressed = true, destination_compress = false, ignore_missing_source = false, destination_path_create = false, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000001.backrest.tmp to absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000001, destination_path_create = false
-DEBUG: safe exit called, terminating threads
+ INFO: archive-get start: --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: get WAL segment 000000010000000100000001
+DEBUG: Archive->get(): strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strSourceArchive = 000000010000000100000001
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: ArchiveInfo->new(): bRequired = true, strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000001
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000001(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = (000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz)
+DEBUG: Archive->walFileName=>: strWalFileName = 000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz
+DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = false, bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = true, lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = 9.3-1/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz, strSourcePathType = backup:archive, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001.backrest.tmp, strSourcePathType = absolute
+DEBUG: Archive->get=>: iResult = 0
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-get stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --stanza=db archive-get 000000010000000100000002 [TEST_PATH]/db/common/pg_xlog/000000010000000100000002
------------------------------------------------------------------------------------------------------------------------------------
- INFO: getting WAL segment 000000010000000100000002
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: Archive->getCheck=>: archiveId = 9.3-1
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000002(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: archive_get: cp 000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz [TEST_PATH]/db/common/pg_xlog/000000010000000100000002
-DEBUG: File->copy: local backup:archive:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz to local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000002, source_compressed = true, destination_compress = false, ignore_missing_source = false, destination_path_create = false, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000002.backrest.tmp to absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000002, destination_path_create = false
-DEBUG: safe exit called, terminating threads
+ INFO: archive-get start: --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: get WAL segment 000000010000000100000002
+DEBUG: Archive->get(): strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000002, strSourceArchive = 000000010000000100000002
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: ArchiveInfo->new(): bRequired = true, strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000002
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000002(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = (000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz)
+DEBUG: Archive->walFileName=>: strWalFileName = 000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz
+DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = false, bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = true, lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000002, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = 9.3-1/000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz, strSourcePathType = backup:archive, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000002, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000002.backrest.tmp, strSourcePathType = absolute
+DEBUG: Archive->get=>: iResult = 0
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-get stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --stanza=db archive-get 000000010000000100000003 [TEST_PATH]/db/common/pg_xlog/000000010000000100000003
------------------------------------------------------------------------------------------------------------------------------------
- INFO: getting WAL segment 000000010000000100000003
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: Archive->getCheck=>: archiveId = 9.3-1
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000003(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: archive_get: cp 000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz [TEST_PATH]/db/common/pg_xlog/000000010000000100000003
-DEBUG: File->copy: local backup:archive:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz to local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000003, source_compressed = true, destination_compress = false, ignore_missing_source = false, destination_path_create = false, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000003.backrest.tmp to absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000003, destination_path_create = false
-DEBUG: safe exit called, terminating threads
+ INFO: archive-get start: --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: get WAL segment 000000010000000100000003
+DEBUG: Archive->get(): strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000003, strSourceArchive = 000000010000000100000003
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: ArchiveInfo->new(): bRequired = true, strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000003
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000003(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = (000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz)
+DEBUG: Archive->walFileName=>: strWalFileName = 000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz
+DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = false, bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = true, lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000003, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = 9.3-1/000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz, strSourcePathType = backup:archive, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000003, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000003.backrest.tmp, strSourcePathType = absolute
+DEBUG: Archive->get=>: iResult = 0
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-get stop
diff --git a/test/log/backup-archive-get-005.log b/test/log/backup-archive-get-005.log
index 732e412ef..4aa2ce3b1 100644
--- a/test/log/backup-archive-get-005.log
+++ b/test/log/backup-archive-get-005.log
@@ -3,13 +3,17 @@ run 005 - rmt 1, cmp 0, exists 0
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --stanza=db archive-get 000000010000000100000001 [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
------------------------------------------------------------------------------------------------------------------------------------
- INFO: getting WAL segment 000000010000000100000001
-DEBUG: Protocol::RemoteMaster->new(): blockSize = 4194304, command = [BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote, compressLevel = 6, compressLevelNetwork = 3, host = 127.0.0.1, user = [USER-1]
-DEBUG: Protocol::CommonMaster->new(): blockSize = 4194304, command = ssh -o Compression=no -o PasswordAuthentication=no backrest@127.0.0.1 '[BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote', compressLevel = 6, compressLevelNetwork = 3, name = remote
+ INFO: archive-get start: --backup-host=127.0.0.1 --backup-user=backrest --cmd-remote=[BACKREST_BIN] --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --repo-path=[TEST_PATH]/local --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: get WAL segment 000000010000000100000001
+DEBUG: Archive->get(): strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strSourceArchive = 000000010000000100000001
+DEBUG: Protocol::RemoteMaster->new(): iBlockSize = 4194304, iCompressLevel = 6, iCompressLevelNetwork = 3, strCommand = [BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote, strHost = 127.0.0.1, strUser = [USER-1]
+DEBUG: Protocol::CommonMaster->new(): iBlockSize = 4194304, iCompressLevel = 6, iCompressLevelNetwork = 3, strCommand = ssh -o Compression=no -o PasswordAuthentication=no backrest@127.0.0.1 '[BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote', strName = remote
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = backup, strStanza = db
ERROR: [130]: archive.info does not exist but is required to get WAL segments
HINT: Is archive_command configured in postgresql.conf?
HINT: Use --no-archive-check to disable archive checks during backup if you have an alternate archiving scheme.
-DEBUG: safe exit called, terminating threads
+DEBUG: Main::safeExit(): iExitCode = 130
+ INFO: archive-get stop
+ supplemental file: [TEST_PATH]/backrest/archive/db/archive.info
-----------------------------------------------------------------
@@ -28,10 +32,17 @@ db-version="9.3"
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --stanza=db archive-get 000000090000000900000009 [TEST_PATH]/db/common/pg_xlog/RECOVERYXLOG
------------------------------------------------------------------------------------------------------------------------------------
- INFO: getting WAL segment 000000090000000900000009
-DEBUG: Protocol::RemoteMaster->new(): blockSize = 4194304, command = [BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote, compressLevel = 6, compressLevelNetwork = 3, host = 127.0.0.1, user = [USER-1]
-DEBUG: Protocol::CommonMaster->new(): blockSize = 4194304, command = ssh -o Compression=no -o PasswordAuthentication=no backrest@127.0.0.1 '[BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote', compressLevel = 6, compressLevelNetwork = 3, name = remote
-DEBUG: Archive->getCheck=>: archiveId = 9.3-1
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000900000009, expression ^000000090000000900000009(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
- INFO: 000000090000000900000009 was not found in the archive repository
-DEBUG: safe exit called, terminating threads
+ INFO: archive-get start: --backup-host=127.0.0.1 --backup-user=backrest --cmd-remote=[BACKREST_BIN] --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --repo-path=[TEST_PATH]/local --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: get WAL segment 000000090000000900000009
+DEBUG: Archive->get(): strDestinationFile = [TEST_PATH]/db/common/pg_xlog/RECOVERYXLOG, strSourceArchive = 000000090000000900000009
+DEBUG: Protocol::RemoteMaster->new(): iBlockSize = 4194304, iCompressLevel = 6, iCompressLevelNetwork = 3, strCommand = [BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote, strHost = 127.0.0.1, strUser = [USER-1]
+DEBUG: Protocol::CommonMaster->new(): iBlockSize = 4194304, iCompressLevel = 6, iCompressLevelNetwork = 3, strCommand = ssh -o Compression=no -o PasswordAuthentication=no backrest@127.0.0.1 '[BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote', strName = remote
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = backup, strStanza = db
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000090000000900000009
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000090000000900000009(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000900000009, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = ()
+DEBUG: Archive->walFileName=>: strWalFileName = [undef]
+ INFO: unable to find 000000090000000900000009 in the archive
+DEBUG: Archive->get=>: iResult = 1
+DEBUG: Main::safeExit(): iExitCode = 1
+ INFO: archive-get stop
diff --git a/test/log/backup-archive-get-006.log b/test/log/backup-archive-get-006.log
index 75a663cea..70828191a 100644
--- a/test/log/backup-archive-get-006.log
+++ b/test/log/backup-archive-get-006.log
@@ -3,13 +3,17 @@ run 006 - rmt 1, cmp 0, exists 1
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --stanza=db archive-get 000000010000000100000001 [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
------------------------------------------------------------------------------------------------------------------------------------
- INFO: getting WAL segment 000000010000000100000001
-DEBUG: Protocol::RemoteMaster->new(): blockSize = 4194304, command = [BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote, compressLevel = 6, compressLevelNetwork = 3, host = 127.0.0.1, user = [USER-1]
-DEBUG: Protocol::CommonMaster->new(): blockSize = 4194304, command = ssh -o Compression=no -o PasswordAuthentication=no backrest@127.0.0.1 '[BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote', compressLevel = 6, compressLevelNetwork = 3, name = remote
+ INFO: archive-get start: --backup-host=127.0.0.1 --backup-user=backrest --cmd-remote=[BACKREST_BIN] --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --repo-path=[TEST_PATH]/local --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: get WAL segment 000000010000000100000001
+DEBUG: Archive->get(): strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strSourceArchive = 000000010000000100000001
+DEBUG: Protocol::RemoteMaster->new(): iBlockSize = 4194304, iCompressLevel = 6, iCompressLevelNetwork = 3, strCommand = [BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote, strHost = 127.0.0.1, strUser = [USER-1]
+DEBUG: Protocol::CommonMaster->new(): iBlockSize = 4194304, iCompressLevel = 6, iCompressLevelNetwork = 3, strCommand = ssh -o Compression=no -o PasswordAuthentication=no backrest@127.0.0.1 '[BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote', strName = remote
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = backup, strStanza = db
ERROR: [130]: archive.info does not exist but is required to get WAL segments
HINT: Is archive_command configured in postgresql.conf?
HINT: Use --no-archive-check to disable archive checks during backup if you have an alternate archiving scheme.
-DEBUG: safe exit called, terminating threads
+DEBUG: Main::safeExit(): iExitCode = 130
+ INFO: archive-get stop
+ supplemental file: [TEST_PATH]/backrest/archive/db/archive.info
-----------------------------------------------------------------
@@ -28,36 +32,54 @@ db-version="9.3"
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --stanza=db archive-get 000000010000000100000001 [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
------------------------------------------------------------------------------------------------------------------------------------
- INFO: getting WAL segment 000000010000000100000001
-DEBUG: Protocol::RemoteMaster->new(): blockSize = 4194304, command = [BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote, compressLevel = 6, compressLevelNetwork = 3, host = 127.0.0.1, user = [USER-1]
-DEBUG: Protocol::CommonMaster->new(): blockSize = 4194304, command = ssh -o Compression=no -o PasswordAuthentication=no backrest@127.0.0.1 '[BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote', compressLevel = 6, compressLevelNetwork = 3, name = remote
-DEBUG: Archive->getCheck=>: archiveId = 9.3-1
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000001(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: archive_get: cp 000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031 [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
-DEBUG: File->copy: remote backup:archive:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031 to local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000001, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = false, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000001.backrest.tmp to absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000001, destination_path_create = false
-DEBUG: safe exit called, terminating threads
+ INFO: archive-get start: --backup-host=127.0.0.1 --backup-user=backrest --cmd-remote=[BACKREST_BIN] --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --repo-path=[TEST_PATH]/local --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: get WAL segment 000000010000000100000001
+DEBUG: Archive->get(): strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strSourceArchive = 000000010000000100000001
+DEBUG: Protocol::RemoteMaster->new(): iBlockSize = 4194304, iCompressLevel = 6, iCompressLevelNetwork = 3, strCommand = [BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote, strHost = 127.0.0.1, strUser = [USER-1]
+DEBUG: Protocol::CommonMaster->new(): iBlockSize = 4194304, iCompressLevel = 6, iCompressLevelNetwork = 3, strCommand = ssh -o Compression=no -o PasswordAuthentication=no backrest@127.0.0.1 '[BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote', strName = remote
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = backup, strStanza = db
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000001
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000001(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = (000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031)
+DEBUG: Archive->walFileName=>: strWalFileName = 000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = false, bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = 9.3-1/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strSourcePathType = backup:archive, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001.backrest.tmp, strSourcePathType = absolute
+DEBUG: Archive->get=>: iResult = 0
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-get stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --stanza=db archive-get 000000010000000100000002 [TEST_PATH]/db/common/pg_xlog/000000010000000100000002
------------------------------------------------------------------------------------------------------------------------------------
- INFO: getting WAL segment 000000010000000100000002
-DEBUG: Protocol::RemoteMaster->new(): blockSize = 4194304, command = [BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote, compressLevel = 6, compressLevelNetwork = 3, host = 127.0.0.1, user = [USER-1]
-DEBUG: Protocol::CommonMaster->new(): blockSize = 4194304, command = ssh -o Compression=no -o PasswordAuthentication=no backrest@127.0.0.1 '[BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote', compressLevel = 6, compressLevelNetwork = 3, name = remote
-DEBUG: Archive->getCheck=>: archiveId = 9.3-1
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000002(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: archive_get: cp 000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031 [TEST_PATH]/db/common/pg_xlog/000000010000000100000002
-DEBUG: File->copy: remote backup:archive:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031 to local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000002, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = false, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000002.backrest.tmp to absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000002, destination_path_create = false
-DEBUG: safe exit called, terminating threads
+ INFO: archive-get start: --backup-host=127.0.0.1 --backup-user=backrest --cmd-remote=[BACKREST_BIN] --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --repo-path=[TEST_PATH]/local --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: get WAL segment 000000010000000100000002
+DEBUG: Archive->get(): strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000002, strSourceArchive = 000000010000000100000002
+DEBUG: Protocol::RemoteMaster->new(): iBlockSize = 4194304, iCompressLevel = 6, iCompressLevelNetwork = 3, strCommand = [BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote, strHost = 127.0.0.1, strUser = [USER-1]
+DEBUG: Protocol::CommonMaster->new(): iBlockSize = 4194304, iCompressLevel = 6, iCompressLevelNetwork = 3, strCommand = ssh -o Compression=no -o PasswordAuthentication=no backrest@127.0.0.1 '[BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote', strName = remote
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = backup, strStanza = db
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000002
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000002(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = (000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031)
+DEBUG: Archive->walFileName=>: strWalFileName = 000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = false, bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000002, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = 9.3-1/000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strSourcePathType = backup:archive, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000002, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000002.backrest.tmp, strSourcePathType = absolute
+DEBUG: Archive->get=>: iResult = 0
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-get stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --stanza=db archive-get 000000010000000100000003 [TEST_PATH]/db/common/pg_xlog/000000010000000100000003
------------------------------------------------------------------------------------------------------------------------------------
- INFO: getting WAL segment 000000010000000100000003
-DEBUG: Protocol::RemoteMaster->new(): blockSize = 4194304, command = [BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote, compressLevel = 6, compressLevelNetwork = 3, host = 127.0.0.1, user = [USER-1]
-DEBUG: Protocol::CommonMaster->new(): blockSize = 4194304, command = ssh -o Compression=no -o PasswordAuthentication=no backrest@127.0.0.1 '[BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote', compressLevel = 6, compressLevelNetwork = 3, name = remote
-DEBUG: Archive->getCheck=>: archiveId = 9.3-1
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000003(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: archive_get: cp 000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031 [TEST_PATH]/db/common/pg_xlog/000000010000000100000003
-DEBUG: File->copy: remote backup:archive:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031 to local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000003, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = false, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000003.backrest.tmp to absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000003, destination_path_create = false
-DEBUG: safe exit called, terminating threads
+ INFO: archive-get start: --backup-host=127.0.0.1 --backup-user=backrest --cmd-remote=[BACKREST_BIN] --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --repo-path=[TEST_PATH]/local --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: get WAL segment 000000010000000100000003
+DEBUG: Archive->get(): strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000003, strSourceArchive = 000000010000000100000003
+DEBUG: Protocol::RemoteMaster->new(): iBlockSize = 4194304, iCompressLevel = 6, iCompressLevelNetwork = 3, strCommand = [BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote, strHost = 127.0.0.1, strUser = [USER-1]
+DEBUG: Protocol::CommonMaster->new(): iBlockSize = 4194304, iCompressLevel = 6, iCompressLevelNetwork = 3, strCommand = ssh -o Compression=no -o PasswordAuthentication=no backrest@127.0.0.1 '[BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote', strName = remote
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = backup, strStanza = db
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000003
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000003(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = (000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031)
+DEBUG: Archive->walFileName=>: strWalFileName = 000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = false, bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000003, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = 9.3-1/000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strSourcePathType = backup:archive, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000003, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000003.backrest.tmp, strSourcePathType = absolute
+DEBUG: Archive->get=>: iResult = 0
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-get stop
diff --git a/test/log/backup-archive-get-007.log b/test/log/backup-archive-get-007.log
index 9a3f61d62..cb190d610 100644
--- a/test/log/backup-archive-get-007.log
+++ b/test/log/backup-archive-get-007.log
@@ -3,13 +3,17 @@ run 007 - rmt 1, cmp 1, exists 0
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --stanza=db archive-get 000000010000000100000001 [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
------------------------------------------------------------------------------------------------------------------------------------
- INFO: getting WAL segment 000000010000000100000001
-DEBUG: Protocol::RemoteMaster->new(): blockSize = 4194304, command = [BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote, compressLevel = 6, compressLevelNetwork = 3, host = 127.0.0.1, user = [USER-1]
-DEBUG: Protocol::CommonMaster->new(): blockSize = 4194304, command = ssh -o Compression=no -o PasswordAuthentication=no backrest@127.0.0.1 '[BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote', compressLevel = 6, compressLevelNetwork = 3, name = remote
+ INFO: archive-get start: --backup-host=127.0.0.1 --backup-user=backrest --cmd-remote=[BACKREST_BIN] --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --repo-path=[TEST_PATH]/local --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: get WAL segment 000000010000000100000001
+DEBUG: Archive->get(): strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strSourceArchive = 000000010000000100000001
+DEBUG: Protocol::RemoteMaster->new(): iBlockSize = 4194304, iCompressLevel = 6, iCompressLevelNetwork = 3, strCommand = [BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote, strHost = 127.0.0.1, strUser = [USER-1]
+DEBUG: Protocol::CommonMaster->new(): iBlockSize = 4194304, iCompressLevel = 6, iCompressLevelNetwork = 3, strCommand = ssh -o Compression=no -o PasswordAuthentication=no backrest@127.0.0.1 '[BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote', strName = remote
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = backup, strStanza = db
ERROR: [130]: archive.info does not exist but is required to get WAL segments
HINT: Is archive_command configured in postgresql.conf?
HINT: Use --no-archive-check to disable archive checks during backup if you have an alternate archiving scheme.
-DEBUG: safe exit called, terminating threads
+DEBUG: Main::safeExit(): iExitCode = 130
+ INFO: archive-get stop
+ supplemental file: [TEST_PATH]/backrest/archive/db/archive.info
-----------------------------------------------------------------
@@ -28,10 +32,17 @@ db-version="9.3"
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --stanza=db archive-get 000000090000000900000009 [TEST_PATH]/db/common/pg_xlog/RECOVERYXLOG
------------------------------------------------------------------------------------------------------------------------------------
- INFO: getting WAL segment 000000090000000900000009
-DEBUG: Protocol::RemoteMaster->new(): blockSize = 4194304, command = [BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote, compressLevel = 6, compressLevelNetwork = 3, host = 127.0.0.1, user = [USER-1]
-DEBUG: Protocol::CommonMaster->new(): blockSize = 4194304, command = ssh -o Compression=no -o PasswordAuthentication=no backrest@127.0.0.1 '[BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote', compressLevel = 6, compressLevelNetwork = 3, name = remote
-DEBUG: Archive->getCheck=>: archiveId = 9.3-1
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000900000009, expression ^000000090000000900000009(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
- INFO: 000000090000000900000009 was not found in the archive repository
-DEBUG: safe exit called, terminating threads
+ INFO: archive-get start: --backup-host=127.0.0.1 --backup-user=backrest --cmd-remote=[BACKREST_BIN] --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --repo-path=[TEST_PATH]/local --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: get WAL segment 000000090000000900000009
+DEBUG: Archive->get(): strDestinationFile = [TEST_PATH]/db/common/pg_xlog/RECOVERYXLOG, strSourceArchive = 000000090000000900000009
+DEBUG: Protocol::RemoteMaster->new(): iBlockSize = 4194304, iCompressLevel = 6, iCompressLevelNetwork = 3, strCommand = [BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote, strHost = 127.0.0.1, strUser = [USER-1]
+DEBUG: Protocol::CommonMaster->new(): iBlockSize = 4194304, iCompressLevel = 6, iCompressLevelNetwork = 3, strCommand = ssh -o Compression=no -o PasswordAuthentication=no backrest@127.0.0.1 '[BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote', strName = remote
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = backup, strStanza = db
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000090000000900000009
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000090000000900000009(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000900000009, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = ()
+DEBUG: Archive->walFileName=>: strWalFileName = [undef]
+ INFO: unable to find 000000090000000900000009 in the archive
+DEBUG: Archive->get=>: iResult = 1
+DEBUG: Main::safeExit(): iExitCode = 1
+ INFO: archive-get stop
diff --git a/test/log/backup-archive-get-008.log b/test/log/backup-archive-get-008.log
index 38b801a50..c73d904a8 100644
--- a/test/log/backup-archive-get-008.log
+++ b/test/log/backup-archive-get-008.log
@@ -3,13 +3,17 @@ run 008 - rmt 1, cmp 1, exists 1
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --stanza=db archive-get 000000010000000100000001 [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
------------------------------------------------------------------------------------------------------------------------------------
- INFO: getting WAL segment 000000010000000100000001
-DEBUG: Protocol::RemoteMaster->new(): blockSize = 4194304, command = [BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote, compressLevel = 6, compressLevelNetwork = 3, host = 127.0.0.1, user = [USER-1]
-DEBUG: Protocol::CommonMaster->new(): blockSize = 4194304, command = ssh -o Compression=no -o PasswordAuthentication=no backrest@127.0.0.1 '[BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote', compressLevel = 6, compressLevelNetwork = 3, name = remote
+ INFO: archive-get start: --backup-host=127.0.0.1 --backup-user=backrest --cmd-remote=[BACKREST_BIN] --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --repo-path=[TEST_PATH]/local --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: get WAL segment 000000010000000100000001
+DEBUG: Archive->get(): strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strSourceArchive = 000000010000000100000001
+DEBUG: Protocol::RemoteMaster->new(): iBlockSize = 4194304, iCompressLevel = 6, iCompressLevelNetwork = 3, strCommand = [BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote, strHost = 127.0.0.1, strUser = [USER-1]
+DEBUG: Protocol::CommonMaster->new(): iBlockSize = 4194304, iCompressLevel = 6, iCompressLevelNetwork = 3, strCommand = ssh -o Compression=no -o PasswordAuthentication=no backrest@127.0.0.1 '[BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote', strName = remote
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = backup, strStanza = db
ERROR: [130]: archive.info does not exist but is required to get WAL segments
HINT: Is archive_command configured in postgresql.conf?
HINT: Use --no-archive-check to disable archive checks during backup if you have an alternate archiving scheme.
-DEBUG: safe exit called, terminating threads
+DEBUG: Main::safeExit(): iExitCode = 130
+ INFO: archive-get stop
+ supplemental file: [TEST_PATH]/backrest/archive/db/archive.info
-----------------------------------------------------------------
@@ -28,36 +32,54 @@ db-version="9.3"
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --stanza=db archive-get 000000010000000100000001 [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
------------------------------------------------------------------------------------------------------------------------------------
- INFO: getting WAL segment 000000010000000100000001
-DEBUG: Protocol::RemoteMaster->new(): blockSize = 4194304, command = [BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote, compressLevel = 6, compressLevelNetwork = 3, host = 127.0.0.1, user = [USER-1]
-DEBUG: Protocol::CommonMaster->new(): blockSize = 4194304, command = ssh -o Compression=no -o PasswordAuthentication=no backrest@127.0.0.1 '[BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote', compressLevel = 6, compressLevelNetwork = 3, name = remote
-DEBUG: Archive->getCheck=>: archiveId = 9.3-1
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000001(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: archive_get: cp 000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
-DEBUG: File->copy: remote backup:archive:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz to local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000001, source_compressed = true, destination_compress = false, ignore_missing_source = false, destination_path_create = false, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000001.backrest.tmp to absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000001, destination_path_create = false
-DEBUG: safe exit called, terminating threads
+ INFO: archive-get start: --backup-host=127.0.0.1 --backup-user=backrest --cmd-remote=[BACKREST_BIN] --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --repo-path=[TEST_PATH]/local --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: get WAL segment 000000010000000100000001
+DEBUG: Archive->get(): strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strSourceArchive = 000000010000000100000001
+DEBUG: Protocol::RemoteMaster->new(): iBlockSize = 4194304, iCompressLevel = 6, iCompressLevelNetwork = 3, strCommand = [BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote, strHost = 127.0.0.1, strUser = [USER-1]
+DEBUG: Protocol::CommonMaster->new(): iBlockSize = 4194304, iCompressLevel = 6, iCompressLevelNetwork = 3, strCommand = ssh -o Compression=no -o PasswordAuthentication=no backrest@127.0.0.1 '[BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote', strName = remote
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = backup, strStanza = db
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000001
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000001(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = (000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz)
+DEBUG: Archive->walFileName=>: strWalFileName = 000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz
+DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = false, bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = true, lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = 9.3-1/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz, strSourcePathType = backup:archive, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001.backrest.tmp, strSourcePathType = absolute
+DEBUG: Archive->get=>: iResult = 0
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-get stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --stanza=db archive-get 000000010000000100000002 [TEST_PATH]/db/common/pg_xlog/000000010000000100000002
------------------------------------------------------------------------------------------------------------------------------------
- INFO: getting WAL segment 000000010000000100000002
-DEBUG: Protocol::RemoteMaster->new(): blockSize = 4194304, command = [BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote, compressLevel = 6, compressLevelNetwork = 3, host = 127.0.0.1, user = [USER-1]
-DEBUG: Protocol::CommonMaster->new(): blockSize = 4194304, command = ssh -o Compression=no -o PasswordAuthentication=no backrest@127.0.0.1 '[BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote', compressLevel = 6, compressLevelNetwork = 3, name = remote
-DEBUG: Archive->getCheck=>: archiveId = 9.3-1
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000002(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: archive_get: cp 000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz [TEST_PATH]/db/common/pg_xlog/000000010000000100000002
-DEBUG: File->copy: remote backup:archive:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz to local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000002, source_compressed = true, destination_compress = false, ignore_missing_source = false, destination_path_create = false, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000002.backrest.tmp to absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000002, destination_path_create = false
-DEBUG: safe exit called, terminating threads
+ INFO: archive-get start: --backup-host=127.0.0.1 --backup-user=backrest --cmd-remote=[BACKREST_BIN] --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --repo-path=[TEST_PATH]/local --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: get WAL segment 000000010000000100000002
+DEBUG: Archive->get(): strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000002, strSourceArchive = 000000010000000100000002
+DEBUG: Protocol::RemoteMaster->new(): iBlockSize = 4194304, iCompressLevel = 6, iCompressLevelNetwork = 3, strCommand = [BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote, strHost = 127.0.0.1, strUser = [USER-1]
+DEBUG: Protocol::CommonMaster->new(): iBlockSize = 4194304, iCompressLevel = 6, iCompressLevelNetwork = 3, strCommand = ssh -o Compression=no -o PasswordAuthentication=no backrest@127.0.0.1 '[BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote', strName = remote
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = backup, strStanza = db
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000002
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000002(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = (000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz)
+DEBUG: Archive->walFileName=>: strWalFileName = 000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz
+DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = false, bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = true, lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000002, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = 9.3-1/000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz, strSourcePathType = backup:archive, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000002, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000002.backrest.tmp, strSourcePathType = absolute
+DEBUG: Archive->get=>: iResult = 0
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-get stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --stanza=db archive-get 000000010000000100000003 [TEST_PATH]/db/common/pg_xlog/000000010000000100000003
------------------------------------------------------------------------------------------------------------------------------------
- INFO: getting WAL segment 000000010000000100000003
-DEBUG: Protocol::RemoteMaster->new(): blockSize = 4194304, command = [BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote, compressLevel = 6, compressLevelNetwork = 3, host = 127.0.0.1, user = [USER-1]
-DEBUG: Protocol::CommonMaster->new(): blockSize = 4194304, command = ssh -o Compression=no -o PasswordAuthentication=no backrest@127.0.0.1 '[BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote', compressLevel = 6, compressLevelNetwork = 3, name = remote
-DEBUG: Archive->getCheck=>: archiveId = 9.3-1
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000003(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: archive_get: cp 000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz [TEST_PATH]/db/common/pg_xlog/000000010000000100000003
-DEBUG: File->copy: remote backup:archive:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz to local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000003, source_compressed = true, destination_compress = false, ignore_missing_source = false, destination_path_create = false, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000003.backrest.tmp to absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000003, destination_path_create = false
-DEBUG: safe exit called, terminating threads
+ INFO: archive-get start: --backup-host=127.0.0.1 --backup-user=backrest --cmd-remote=[BACKREST_BIN] --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --repo-path=[TEST_PATH]/local --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: get WAL segment 000000010000000100000003
+DEBUG: Archive->get(): strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000003, strSourceArchive = 000000010000000100000003
+DEBUG: Protocol::RemoteMaster->new(): iBlockSize = 4194304, iCompressLevel = 6, iCompressLevelNetwork = 3, strCommand = [BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote, strHost = 127.0.0.1, strUser = [USER-1]
+DEBUG: Protocol::CommonMaster->new(): iBlockSize = 4194304, iCompressLevel = 6, iCompressLevelNetwork = 3, strCommand = ssh -o Compression=no -o PasswordAuthentication=no backrest@127.0.0.1 '[BACKREST_BIN] --no-config --db-port=[PORT-1] --db-socket-path=[TEST_PATH]/db --repo-remote-path=[TEST_PATH]/backrest --stanza=db remote', strName = remote
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = backup, strStanza = db
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000003
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000003(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = (000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz)
+DEBUG: Archive->walFileName=>: strWalFileName = 000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz
+DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = false, bDestinationPathCreate = , bIgnoreMissingSource = , bSourceCompressed = true, lModificationTime = [undef], strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000003, strDestinationPathType = db:absolute, strGroup = [undef], strMode = <0640>, strSourceFile = 9.3-1/000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz, strSourcePathType = backup:archive, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = false, strDestinationFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000003, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000003.backrest.tmp, strSourcePathType = absolute
+DEBUG: Archive->get=>: iResult = 0
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-get stop
diff --git a/test/log/backup-archive-push-001.log b/test/log/backup-archive-push-001.log
index 34e233150..6da7031d0 100644
--- a/test/log/backup-archive-push-001.log
+++ b/test/log/backup-archive-push-001.log
@@ -3,235 +3,503 @@ run 001 - rmt 0, cmp 0, arc_async 0
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000001
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: File->path_create: backup:archive:[TEST_PATH]/backrest/archive/db, mode 0750
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000001(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->exists: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000001 to local backup:archive:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000001, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->path_create: absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, mode 0750
-DEBUG: File->exists: absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000001.tmp to absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031, destination_path_create = true
-DEBUG: safe exit called, terminating threads
+ INFO: archive-push start: --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
+DEBUG: Archive->pushProcess(): bAsync = false, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strWalSegment = 000000010000000100000001, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = false
+DEBUG: File->pathCreate(): bIgnoreExists = , strMode = <0750>, strPath = [undef], strPathType = backup:archive
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000001
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000001(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->exists(): strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute
+DEBUG: File->exists=>: bExists = false
+DEBUG: Archive->walFileName=>: strWalFileName = [undef]
+DEBUG: Archive->pushCheck=>: strArchiveId = 9.3-1, strChecksum = [undef]
+DEBUG: File->copy(): bAppendChecksum = true, bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 9.3-1/000000010000000100000001, strDestinationPathType = backup:archive, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->pathCreate(): bIgnoreExists = true, strMode = <0750>, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = absolute
+DEBUG: File->exists(): strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = absolute
+DEBUG: File->exists=>: bExists = false
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000001.tmp, strSourcePathType = absolute
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000001
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
+ INFO: archive-push start: --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
+DEBUG: Archive->pushProcess(): bAsync = false, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strWalSegment = 000000010000000100000001, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
ERROR: [119]: WAL segment version 9.3 does not match archive version 8.0
HINT: are you archiving to the correct stanza?
-DEBUG: safe exit called, terminating threads
+DEBUG: Main::safeExit(): iExitCode = 119
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000001
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
+ INFO: archive-push start: --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
+DEBUG: Archive->pushProcess(): bAsync = false, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strWalSegment = 000000010000000100000001, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
ERROR: [119]: WAL segment system-id 5947969990501855219 does not match archive system-id 5000900090001855000
HINT: are you archiving to the correct stanza?
-DEBUG: safe exit called, terminating threads
+DEBUG: Main::safeExit(): iExitCode = 119
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000001
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000001(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->hash: db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000001, compressed = false, hash_type = sha1
+ INFO: archive-push start: --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
+DEBUG: Archive->pushProcess(): bAsync = false, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strWalSegment = 000000010000000100000001, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000001
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000001(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = (000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031)
+DEBUG: Archive->walFileName=>: strWalFileName = 000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: File->hash(): bCompressed = [undef], strFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strHashType = [undef], strPathType = db:absolute
+DEBUG: File->hashSize(): bCompressed = , strFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strHashType = , strPathType = db:absolute
+DEBUG: File->hashSize=>: iSize = 16777216, strHash = 1c7e00fd09b9dd11fc2966590b3e3274645dd031
WARN: WAL segment 000000010000000100000001 already exists in the archive with the same checksum
HINT: this is valid in some recovery scenarios but may also indicate a problem
-DEBUG: safe exit called, terminating threads
+DEBUG: Archive->pushCheck=>: strArchiveId = 9.3-1, strChecksum = 1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000001
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000001(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->hash: db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000001, compressed = false, hash_type = sha1
+ INFO: archive-push start: --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
+DEBUG: Archive->pushProcess(): bAsync = false, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strWalSegment = 000000010000000100000001, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000001
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000001(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = (000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031)
+DEBUG: Archive->walFileName=>: strWalFileName = 000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: File->hash(): bCompressed = [undef], strFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strHashType = [undef], strPathType = db:absolute
+DEBUG: File->hashSize(): bCompressed = , strFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strHashType = , strPathType = db:absolute
+DEBUG: File->hashSize=>: iSize = 16777216, strHash = 4518a0fdf41d796760b384a358270d4682589820
ERROR: [120]: WAL segment 000000010000000100000001 already exists in the archive
-DEBUG: safe exit called, terminating threads
+DEBUG: Main::safeExit(): iExitCode = 120
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000002
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000002
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000002
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000002(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000002 to local backup:archive:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000002, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000002.tmp to absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031, destination_path_create = true
-DEBUG: safe exit called, terminating threads
+ INFO: archive-push start: --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000002
+DEBUG: Archive->pushProcess(): bAsync = false, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000002
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000002
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000002, strWalSegment = 000000010000000100000002, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000002
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000002(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = ()
+DEBUG: Archive->walFileName=>: strWalFileName = [undef]
+DEBUG: Archive->pushCheck=>: strArchiveId = 9.3-1, strChecksum = [undef]
+DEBUG: File->copy(): bAppendChecksum = true, bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 9.3-1/000000010000000100000002, strDestinationPathType = backup:archive, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000002, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000002.tmp, strSourcePathType = absolute
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000003
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000003
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000003
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000003(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000003 to local backup:archive:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000003, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000003.tmp to absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031, destination_path_create = true
-DEBUG: safe exit called, terminating threads
+ INFO: archive-push start: --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000003
+DEBUG: Archive->pushProcess(): bAsync = false, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000003
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000003
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000003, strWalSegment = 000000010000000100000003, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000003
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000003(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = ()
+DEBUG: Archive->walFileName=>: strWalFileName = [undef]
+DEBUG: Archive->pushCheck=>: strArchiveId = 9.3-1, strChecksum = [undef]
+DEBUG: File->copy(): bAppendChecksum = true, bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 9.3-1/000000010000000100000003, strDestinationPathType = backup:archive, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000003, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000003.tmp, strSourcePathType = absolute
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000004
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000004
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000004
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000004(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000004 to local backup:archive:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000004, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000004.tmp to absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000004-1c7e00fd09b9dd11fc2966590b3e3274645dd031, destination_path_create = true
-DEBUG: safe exit called, terminating threads
+ INFO: archive-push start: --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000004
+DEBUG: Archive->pushProcess(): bAsync = false, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000004
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000004
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000004, strWalSegment = 000000010000000100000004, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000004
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000004(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = ()
+DEBUG: Archive->walFileName=>: strWalFileName = [undef]
+DEBUG: Archive->pushCheck=>: strArchiveId = 9.3-1, strChecksum = [undef]
+DEBUG: File->copy(): bAppendChecksum = true, bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 9.3-1/000000010000000100000004, strDestinationPathType = backup:archive, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000004, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000004-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000004.tmp, strSourcePathType = absolute
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000005
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000005(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000005 to local backup:archive:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000005, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000005.tmp to absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031, destination_path_create = true
-DEBUG: safe exit called, terminating threads
+ INFO: archive-push start: --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
+DEBUG: Archive->pushProcess(): bAsync = false, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005, strWalSegment = 000000010000000100000005, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000005
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000005(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = ()
+DEBUG: Archive->walFileName=>: strWalFileName = [undef]
+DEBUG: Archive->pushCheck=>: strArchiveId = 9.3-1, strChecksum = [undef]
+DEBUG: File->copy(): bAppendChecksum = true, bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 9.3-1/000000010000000100000005, strDestinationPathType = backup:archive, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000005.tmp, strSourcePathType = absolute
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000005
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
+ INFO: archive-push start: --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
+DEBUG: Archive->pushProcess(): bAsync = false, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005, strWalSegment = 000000010000000100000005, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
ERROR: [119]: WAL segment version 9.3 does not match archive version 8.0
HINT: are you archiving to the correct stanza?
-DEBUG: safe exit called, terminating threads
+DEBUG: Main::safeExit(): iExitCode = 119
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000005
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
+ INFO: archive-push start: --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
+DEBUG: Archive->pushProcess(): bAsync = false, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005, strWalSegment = 000000010000000100000005, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
ERROR: [119]: WAL segment system-id 5947969990501855219 does not match archive system-id 5000900090001855000
HINT: are you archiving to the correct stanza?
-DEBUG: safe exit called, terminating threads
+DEBUG: Main::safeExit(): iExitCode = 119
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000005
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000005(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->hash: db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000005, compressed = false, hash_type = sha1
+ INFO: archive-push start: --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
+DEBUG: Archive->pushProcess(): bAsync = false, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005, strWalSegment = 000000010000000100000005, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000005
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000005(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = (000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031)
+DEBUG: Archive->walFileName=>: strWalFileName = 000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: File->hash(): bCompressed = [undef], strFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005, strHashType = [undef], strPathType = db:absolute
+DEBUG: File->hashSize(): bCompressed = , strFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005, strHashType = , strPathType = db:absolute
+DEBUG: File->hashSize=>: iSize = 16777216, strHash = 1c7e00fd09b9dd11fc2966590b3e3274645dd031
WARN: WAL segment 000000010000000100000005 already exists in the archive with the same checksum
HINT: this is valid in some recovery scenarios but may also indicate a problem
-DEBUG: safe exit called, terminating threads
+DEBUG: Archive->pushCheck=>: strArchiveId = 9.3-1, strChecksum = 1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000005
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000005(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->hash: db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000005, compressed = false, hash_type = sha1
+ INFO: archive-push start: --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
+DEBUG: Archive->pushProcess(): bAsync = false, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005, strWalSegment = 000000010000000100000005, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000005
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000005(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = (000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031)
+DEBUG: Archive->walFileName=>: strWalFileName = 000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: File->hash(): bCompressed = [undef], strFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005, strHashType = [undef], strPathType = db:absolute
+DEBUG: File->hashSize(): bCompressed = , strFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005, strHashType = , strPathType = db:absolute
+DEBUG: File->hashSize=>: iSize = 16777216, strHash = 4518a0fdf41d796760b384a358270d4682589820
ERROR: [120]: WAL segment 000000010000000100000005 already exists in the archive
-DEBUG: safe exit called, terminating threads
+DEBUG: Main::safeExit(): iExitCode = 120
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000006
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000006
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000006
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000006(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000006 to local backup:archive:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000006, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000006.tmp to absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000006-1c7e00fd09b9dd11fc2966590b3e3274645dd031, destination_path_create = true
-DEBUG: safe exit called, terminating threads
+ INFO: archive-push start: --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000006
+DEBUG: Archive->pushProcess(): bAsync = false, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000006
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000006
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000006, strWalSegment = 000000010000000100000006, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000006
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000006(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = ()
+DEBUG: Archive->walFileName=>: strWalFileName = [undef]
+DEBUG: Archive->pushCheck=>: strArchiveId = 9.3-1, strChecksum = [undef]
+DEBUG: File->copy(): bAppendChecksum = true, bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 9.3-1/000000010000000100000006, strDestinationPathType = backup:archive, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000006, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000006-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000006.tmp, strSourcePathType = absolute
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000007
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000007
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000007
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000007(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000007 to local backup:archive:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000007, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000007.tmp to absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000007-1c7e00fd09b9dd11fc2966590b3e3274645dd031, destination_path_create = true
-DEBUG: safe exit called, terminating threads
+ INFO: archive-push start: --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000007
+DEBUG: Archive->pushProcess(): bAsync = false, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000007
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000007
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000007, strWalSegment = 000000010000000100000007, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000007
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000007(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = ()
+DEBUG: Archive->walFileName=>: strWalFileName = [undef]
+DEBUG: Archive->pushCheck=>: strArchiveId = 9.3-1, strChecksum = [undef]
+DEBUG: File->copy(): bAppendChecksum = true, bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 9.3-1/000000010000000100000007, strDestinationPathType = backup:archive, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000007, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000007-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000007.tmp, strSourcePathType = absolute
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000008
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000008
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000008
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000008(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000008 to local backup:archive:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000008, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000008.tmp to absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000008-1c7e00fd09b9dd11fc2966590b3e3274645dd031, destination_path_create = true
-DEBUG: safe exit called, terminating threads
+ INFO: archive-push start: --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000008
+DEBUG: Archive->pushProcess(): bAsync = false, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000008
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000008
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000008, strWalSegment = 000000010000000100000008, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000008
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000008(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = ()
+DEBUG: Archive->walFileName=>: strWalFileName = [undef]
+DEBUG: Archive->pushCheck=>: strArchiveId = 9.3-1, strChecksum = [undef]
+DEBUG: File->copy(): bAppendChecksum = true, bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 9.3-1/000000010000000100000008, strDestinationPathType = backup:archive, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000008, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000008-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000008.tmp, strSourcePathType = absolute
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000009
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000009
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000009
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000009(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000009 to local backup:archive:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000009, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000009.tmp to absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031, destination_path_create = true
-DEBUG: safe exit called, terminating threads
+ INFO: archive-push start: --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000009
+DEBUG: Archive->pushProcess(): bAsync = false, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000009
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000009
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000009, strWalSegment = 000000010000000100000009, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000009
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000009(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = ()
+DEBUG: Archive->walFileName=>: strWalFileName = [undef]
+DEBUG: Archive->pushCheck=>: strArchiveId = 9.3-1, strChecksum = [undef]
+DEBUG: File->copy(): bAppendChecksum = true, bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 9.3-1/000000010000000100000009, strDestinationPathType = backup:archive, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000009, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000009.tmp, strSourcePathType = absolute
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000009
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000009
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000009
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
+ INFO: archive-push start: --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000009
+DEBUG: Archive->pushProcess(): bAsync = false, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000009
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000009
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000009, strWalSegment = 000000010000000100000009, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
ERROR: [119]: WAL segment version 9.3 does not match archive version 8.0
HINT: are you archiving to the correct stanza?
-DEBUG: safe exit called, terminating threads
+DEBUG: Main::safeExit(): iExitCode = 119
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000009
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000009
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000009
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
+ INFO: archive-push start: --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000009
+DEBUG: Archive->pushProcess(): bAsync = false, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000009
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000009
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000009, strWalSegment = 000000010000000100000009, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
ERROR: [119]: WAL segment system-id 5947969990501855219 does not match archive system-id 5000900090001855000
HINT: are you archiving to the correct stanza?
-DEBUG: safe exit called, terminating threads
+DEBUG: Main::safeExit(): iExitCode = 119
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000009
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000009
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000009
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000009(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->hash: db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000009, compressed = false, hash_type = sha1
+ INFO: archive-push start: --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000009
+DEBUG: Archive->pushProcess(): bAsync = false, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000009
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000009
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000009, strWalSegment = 000000010000000100000009, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000009
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000009(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = (000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031)
+DEBUG: Archive->walFileName=>: strWalFileName = 000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: File->hash(): bCompressed = [undef], strFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000009, strHashType = [undef], strPathType = db:absolute
+DEBUG: File->hashSize(): bCompressed = , strFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000009, strHashType = , strPathType = db:absolute
+DEBUG: File->hashSize=>: iSize = 16777216, strHash = 1c7e00fd09b9dd11fc2966590b3e3274645dd031
WARN: WAL segment 000000010000000100000009 already exists in the archive with the same checksum
HINT: this is valid in some recovery scenarios but may also indicate a problem
-DEBUG: safe exit called, terminating threads
+DEBUG: Archive->pushCheck=>: strArchiveId = 9.3-1, strChecksum = 1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000009
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000009
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000009
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000009(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->hash: db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000009, compressed = false, hash_type = sha1
+ INFO: archive-push start: --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000009
+DEBUG: Archive->pushProcess(): bAsync = false, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000009
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000009
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000009, strWalSegment = 000000010000000100000009, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000009
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000009(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = (000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031)
+DEBUG: Archive->walFileName=>: strWalFileName = 000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: File->hash(): bCompressed = [undef], strFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000009, strHashType = [undef], strPathType = db:absolute
+DEBUG: File->hashSize(): bCompressed = , strFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000009, strHashType = , strPathType = db:absolute
+DEBUG: File->hashSize=>: iSize = 16777216, strHash = 4518a0fdf41d796760b384a358270d4682589820
ERROR: [120]: WAL segment 000000010000000100000009 already exists in the archive
-DEBUG: safe exit called, terminating threads
+DEBUG: Main::safeExit(): iExitCode = 120
+ INFO: archive-push stop
+ supplemental file: [TEST_PATH]/backrest/archive/db/archive.info
-----------------------------------------------------------------
diff --git a/test/log/backup-archive-push-002.log b/test/log/backup-archive-push-002.log
index e7f4201af..a289388e8 100644
--- a/test/log/backup-archive-push-002.log
+++ b/test/log/backup-archive-push-002.log
@@ -3,431 +3,811 @@ run 002 - rmt 0, cmp 0, arc_async 1
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000001 asynchronously
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000001 to local backup:archive:out:[TEST_PATH]/backrest/archive/db/out/000000010000000100000001, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->path_create: absolute:[TEST_PATH]/backrest/archive/db/out, mode 0750
-DEBUG: File->exists: absolute:[TEST_PATH]/backrest/archive/db/out
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000001.tmp to absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031, destination_path_create = true
-DEBUG: No fork on archive local for TESTING
-DEBUG: starting async archive-push
-DEBUG: File->manifest: db:absolute:[TEST_PATH]/backrest/archive/db/out
- INFO: archive to be copied to backup total 1, size 16MB
-DEBUG: archive 000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031, is WAL 1, source_compressed = 0, destination_compress 0, default_compress = 0
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000001
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000001(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->exists: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031 to local backup:archive:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->path_create: absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, mode 0750
-DEBUG: File->exists: absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031.tmp to absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031, destination_path_create = true
-DEBUG: transferred 1 WAL segment(s), calling Archive->xfer() again
-DEBUG: File->manifest: db:absolute:[TEST_PATH]/backrest/archive/db/out
-DEBUG: no archive logs to be copied to backup
-DEBUG: transfer found 0 WAL segments - exiting
-DEBUG: safe exit called, terminating threads
+ INFO: archive-push start: --archive-async --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000001 asynchronously
+DEBUG: Archive->pushProcess(): bAsync = true, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->copy(): bAppendChecksum = true, bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 000000010000000100000001, strDestinationPathType = backup:archive:out, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->pathCreate(): bIgnoreExists = true, strMode = <0750>, strPath = [TEST_PATH]/backrest/archive/db/out, strPathType = absolute
+DEBUG: File->exists(): strPath = [TEST_PATH]/backrest/archive/db/out, strPathType = absolute
+DEBUG: File->exists=>: bExists = false
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000001.tmp, strSourcePathType = absolute
+DEBUG: Archive->pushProcess: no fork on archive local for TESTING
+DEBUG: Archive->pushProcess: start async archive-push
+DEBUG: Archive->xfer(): strArchivePath = [TEST_PATH]/backrest/archive/db/out, strStopFile = [TEST_PATH]/backrest/lock/db-archive.stop
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->manifest(): oManifestHashRef = [hash], strPath = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: File->manifestRecurse(): iDepth = 0, oManifestHashRef = [hash], strPathFileOp = [undef], strPathOp = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+ INFO: WAL segments to archive: total = 1, size = 16MB
+DEBUG: Archive->xfer: bArchiveFile = true, bDestinationCompress = false, bSourceCompressed = false, strFile = 000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strWalSegment = 000000010000000100000001, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000001
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000001(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->exists(): strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute
+DEBUG: File->exists=>: bExists = false
+DEBUG: Archive->walFileName=>: strWalFileName = [undef]
+DEBUG: Archive->pushCheck=>: strArchiveId = 9.3-1, strChecksum = [undef]
+DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 9.3-1/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = backup:archive, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->pathCreate(): bIgnoreExists = true, strMode = <0750>, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = absolute
+DEBUG: File->exists(): strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = absolute
+DEBUG: File->exists=>: bExists = false
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031.tmp, strSourcePathType = absolute
+DEBUG: Archive->xfer=>: lFileTotal = 1
+DEBUG: Archive->pushProcess: transferred 1 WAL segment, calling Archive->xfer() again
+DEBUG: Archive->xfer(): strArchivePath = [TEST_PATH]/backrest/archive/db/out, strStopFile = [TEST_PATH]/backrest/lock/db-archive.stop
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->manifest(): oManifestHashRef = [hash], strPath = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: File->manifestRecurse(): iDepth = 0, oManifestHashRef = [hash], strPathFileOp = [undef], strPathOp = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: Archive->xfer: no WAL segments to archive
+DEBUG: Archive->pushProcess: transfer found 0 WAL segments - exiting
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000001 asynchronously
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000001 to local backup:archive:out:[TEST_PATH]/backrest/archive/db/out/000000010000000100000001, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000001.tmp to absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031, destination_path_create = true
-DEBUG: No fork on archive local for TESTING
-DEBUG: starting async archive-push
-DEBUG: File->manifest: db:absolute:[TEST_PATH]/backrest/archive/db/out
- INFO: archive to be copied to backup total 1, size 16MB
-DEBUG: archive 000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031, is WAL 1, source_compressed = 0, destination_compress 0, default_compress = 0
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000001
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
+ INFO: archive-push start: --archive-async --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000001 asynchronously
+DEBUG: Archive->pushProcess(): bAsync = true, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->copy(): bAppendChecksum = true, bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 000000010000000100000001, strDestinationPathType = backup:archive:out, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000001.tmp, strSourcePathType = absolute
+DEBUG: Archive->pushProcess: no fork on archive local for TESTING
+DEBUG: Archive->pushProcess: start async archive-push
+DEBUG: Archive->xfer(): strArchivePath = [TEST_PATH]/backrest/archive/db/out, strStopFile = [TEST_PATH]/backrest/lock/db-archive.stop
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->manifest(): oManifestHashRef = [hash], strPath = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: File->manifestRecurse(): iDepth = 0, oManifestHashRef = [hash], strPathFileOp = [undef], strPathOp = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+ INFO: WAL segments to archive: total = 1, size = 16MB
+DEBUG: Archive->xfer: bArchiveFile = true, bDestinationCompress = false, bSourceCompressed = false, strFile = 000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strWalSegment = 000000010000000100000001, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
ERROR: [119]: WAL segment version 9.3 does not match archive version 8.0
HINT: are you archiving to the correct stanza?
-DEBUG: safe exit called, terminating threads
+DEBUG: Main::safeExit(): iExitCode = 119
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000001 asynchronously
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000001 to local backup:archive:out:[TEST_PATH]/backrest/archive/db/out/000000010000000100000001, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000001.tmp to absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031, destination_path_create = true
-DEBUG: No fork on archive local for TESTING
-DEBUG: starting async archive-push
-DEBUG: File->manifest: db:absolute:[TEST_PATH]/backrest/archive/db/out
- INFO: archive to be copied to backup total 1, size 16MB
-DEBUG: archive 000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031, is WAL 1, source_compressed = 0, destination_compress 0, default_compress = 0
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000001
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
+ INFO: archive-push start: --archive-async --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000001 asynchronously
+DEBUG: Archive->pushProcess(): bAsync = true, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->copy(): bAppendChecksum = true, bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 000000010000000100000001, strDestinationPathType = backup:archive:out, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000001.tmp, strSourcePathType = absolute
+DEBUG: Archive->pushProcess: no fork on archive local for TESTING
+DEBUG: Archive->pushProcess: start async archive-push
+DEBUG: Archive->xfer(): strArchivePath = [TEST_PATH]/backrest/archive/db/out, strStopFile = [TEST_PATH]/backrest/lock/db-archive.stop
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->manifest(): oManifestHashRef = [hash], strPath = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: File->manifestRecurse(): iDepth = 0, oManifestHashRef = [hash], strPathFileOp = [undef], strPathOp = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+ INFO: WAL segments to archive: total = 1, size = 16MB
+DEBUG: Archive->xfer: bArchiveFile = true, bDestinationCompress = false, bSourceCompressed = false, strFile = 000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strWalSegment = 000000010000000100000001, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
ERROR: [119]: WAL segment system-id 5947969990501855219 does not match archive system-id 5000900090001855000
HINT: are you archiving to the correct stanza?
-DEBUG: safe exit called, terminating threads
+DEBUG: Main::safeExit(): iExitCode = 119
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000001 asynchronously
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000001 to local backup:archive:out:[TEST_PATH]/backrest/archive/db/out/000000010000000100000001, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000001.tmp to absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031, destination_path_create = true
-DEBUG: No fork on archive local for TESTING
-DEBUG: starting async archive-push
-DEBUG: File->manifest: db:absolute:[TEST_PATH]/backrest/archive/db/out
- INFO: archive to be copied to backup total 1, size 16MB
-DEBUG: archive 000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031, is WAL 1, source_compressed = 0, destination_compress 0, default_compress = 0
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000001
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000001(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->hash: db:absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031, compressed = false, hash_type = sha1
+ INFO: archive-push start: --archive-async --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000001 asynchronously
+DEBUG: Archive->pushProcess(): bAsync = true, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->copy(): bAppendChecksum = true, bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 000000010000000100000001, strDestinationPathType = backup:archive:out, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000001.tmp, strSourcePathType = absolute
+DEBUG: Archive->pushProcess: no fork on archive local for TESTING
+DEBUG: Archive->pushProcess: start async archive-push
+DEBUG: Archive->xfer(): strArchivePath = [TEST_PATH]/backrest/archive/db/out, strStopFile = [TEST_PATH]/backrest/lock/db-archive.stop
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->manifest(): oManifestHashRef = [hash], strPath = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: File->manifestRecurse(): iDepth = 0, oManifestHashRef = [hash], strPathFileOp = [undef], strPathOp = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+ INFO: WAL segments to archive: total = 1, size = 16MB
+DEBUG: Archive->xfer: bArchiveFile = true, bDestinationCompress = false, bSourceCompressed = false, strFile = 000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strWalSegment = 000000010000000100000001, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000001
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000001(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = (000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031)
+DEBUG: Archive->walFileName=>: strWalFileName = 000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: File->hash(): bCompressed = [undef], strFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strHashType = [undef], strPathType = db:absolute
+DEBUG: File->hashSize(): bCompressed = , strFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strHashType = , strPathType = db:absolute
+DEBUG: File->hashSize=>: iSize = 16777216, strHash = 1c7e00fd09b9dd11fc2966590b3e3274645dd031
WARN: WAL segment 000000010000000100000001 already exists in the archive with the same checksum
HINT: this is valid in some recovery scenarios but may also indicate a problem
-DEBUG: transferred 1 WAL segment(s), calling Archive->xfer() again
-DEBUG: File->manifest: db:absolute:[TEST_PATH]/backrest/archive/db/out
-DEBUG: no archive logs to be copied to backup
-DEBUG: transfer found 0 WAL segments - exiting
-DEBUG: safe exit called, terminating threads
+DEBUG: Archive->pushCheck=>: strArchiveId = 9.3-1, strChecksum = 1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->xfer=>: lFileTotal = 1
+DEBUG: Archive->pushProcess: transferred 1 WAL segment, calling Archive->xfer() again
+DEBUG: Archive->xfer(): strArchivePath = [TEST_PATH]/backrest/archive/db/out, strStopFile = [TEST_PATH]/backrest/lock/db-archive.stop
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->manifest(): oManifestHashRef = [hash], strPath = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: File->manifestRecurse(): iDepth = 0, oManifestHashRef = [hash], strPathFileOp = [undef], strPathOp = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: Archive->xfer: no WAL segments to archive
+DEBUG: Archive->pushProcess: transfer found 0 WAL segments - exiting
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000001 asynchronously
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000001 to local backup:archive:out:[TEST_PATH]/backrest/archive/db/out/000000010000000100000001, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000001.tmp to absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000001-4518a0fdf41d796760b384a358270d4682589820, destination_path_create = true
-DEBUG: No fork on archive local for TESTING
-DEBUG: starting async archive-push
-DEBUG: File->manifest: db:absolute:[TEST_PATH]/backrest/archive/db/out
- INFO: archive to be copied to backup total 1, size 16MB
-DEBUG: archive 000000010000000100000001-4518a0fdf41d796760b384a358270d4682589820, is WAL 1, source_compressed = 0, destination_compress 0, default_compress = 0
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000001
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000001(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->hash: db:absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000001-4518a0fdf41d796760b384a358270d4682589820, compressed = false, hash_type = sha1
+ INFO: archive-push start: --archive-async --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000001 asynchronously
+DEBUG: Archive->pushProcess(): bAsync = true, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->copy(): bAppendChecksum = true, bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 000000010000000100000001, strDestinationPathType = backup:archive:out, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000001-4518a0fdf41d796760b384a358270d4682589820, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000001.tmp, strSourcePathType = absolute
+DEBUG: Archive->pushProcess: no fork on archive local for TESTING
+DEBUG: Archive->pushProcess: start async archive-push
+DEBUG: Archive->xfer(): strArchivePath = [TEST_PATH]/backrest/archive/db/out, strStopFile = [TEST_PATH]/backrest/lock/db-archive.stop
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->manifest(): oManifestHashRef = [hash], strPath = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: File->manifestRecurse(): iDepth = 0, oManifestHashRef = [hash], strPathFileOp = [undef], strPathOp = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+ INFO: WAL segments to archive: total = 1, size = 16MB
+DEBUG: Archive->xfer: bArchiveFile = true, bDestinationCompress = false, bSourceCompressed = false, strFile = 000000010000000100000001-4518a0fdf41d796760b384a358270d4682589820
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000001-4518a0fdf41d796760b384a358270d4682589820
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000001-4518a0fdf41d796760b384a358270d4682589820, strWalSegment = 000000010000000100000001, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000001
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000001(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = (000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031)
+DEBUG: Archive->walFileName=>: strWalFileName = 000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: File->hash(): bCompressed = [undef], strFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000001-4518a0fdf41d796760b384a358270d4682589820, strHashType = [undef], strPathType = db:absolute
+DEBUG: File->hashSize(): bCompressed = , strFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000001-4518a0fdf41d796760b384a358270d4682589820, strHashType = , strPathType = db:absolute
+DEBUG: File->hashSize=>: iSize = 16777216, strHash = 4518a0fdf41d796760b384a358270d4682589820
ERROR: [120]: WAL segment 000000010000000100000001 already exists in the archive
-DEBUG: safe exit called, terminating threads
+DEBUG: Main::safeExit(): iExitCode = 120
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000002
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000002 asynchronously
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000002 to local backup:archive:out:[TEST_PATH]/backrest/archive/db/out/000000010000000100000002, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000002.tmp to absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031, destination_path_create = true
-DEBUG: No fork on archive local for TESTING
-DEBUG: starting async archive-push
-DEBUG: File->manifest: db:absolute:[TEST_PATH]/backrest/archive/db/out
- INFO: archive to be copied to backup total 1, size 16MB
-DEBUG: archive 000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031, is WAL 1, source_compressed = 0, destination_compress 0, default_compress = 0
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000002
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000002(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031 to local backup:archive:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031.tmp to absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031, destination_path_create = true
-DEBUG: transferred 1 WAL segment(s), calling Archive->xfer() again
-DEBUG: File->manifest: db:absolute:[TEST_PATH]/backrest/archive/db/out
-DEBUG: no archive logs to be copied to backup
-DEBUG: transfer found 0 WAL segments - exiting
-DEBUG: safe exit called, terminating threads
+ INFO: archive-push start: --archive-async --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000002 asynchronously
+DEBUG: Archive->pushProcess(): bAsync = true, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000002
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->copy(): bAppendChecksum = true, bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 000000010000000100000002, strDestinationPathType = backup:archive:out, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000002, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000002.tmp, strSourcePathType = absolute
+DEBUG: Archive->pushProcess: no fork on archive local for TESTING
+DEBUG: Archive->pushProcess: start async archive-push
+DEBUG: Archive->xfer(): strArchivePath = [TEST_PATH]/backrest/archive/db/out, strStopFile = [TEST_PATH]/backrest/lock/db-archive.stop
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->manifest(): oManifestHashRef = [hash], strPath = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: File->manifestRecurse(): iDepth = 0, oManifestHashRef = [hash], strPathFileOp = [undef], strPathOp = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+ INFO: WAL segments to archive: total = 1, size = 16MB
+DEBUG: Archive->xfer: bArchiveFile = true, bDestinationCompress = false, bSourceCompressed = false, strFile = 000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strWalSegment = 000000010000000100000002, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000002
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000002(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = ()
+DEBUG: Archive->walFileName=>: strWalFileName = [undef]
+DEBUG: Archive->pushCheck=>: strArchiveId = 9.3-1, strChecksum = [undef]
+DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 9.3-1/000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = backup:archive, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031.tmp, strSourcePathType = absolute
+DEBUG: Archive->xfer=>: lFileTotal = 1
+DEBUG: Archive->pushProcess: transferred 1 WAL segment, calling Archive->xfer() again
+DEBUG: Archive->xfer(): strArchivePath = [TEST_PATH]/backrest/archive/db/out, strStopFile = [TEST_PATH]/backrest/lock/db-archive.stop
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->manifest(): oManifestHashRef = [hash], strPath = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: File->manifestRecurse(): iDepth = 0, oManifestHashRef = [hash], strPathFileOp = [undef], strPathOp = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: Archive->xfer: no WAL segments to archive
+DEBUG: Archive->pushProcess: transfer found 0 WAL segments - exiting
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000003
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000003 asynchronously
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000003 to local backup:archive:out:[TEST_PATH]/backrest/archive/db/out/000000010000000100000003, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000003.tmp to absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031, destination_path_create = true
-DEBUG: No fork on archive local for TESTING
-DEBUG: starting async archive-push
-DEBUG: File->manifest: db:absolute:[TEST_PATH]/backrest/archive/db/out
- INFO: archive to be copied to backup total 1, size 16MB
-DEBUG: archive 000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031, is WAL 1, source_compressed = 0, destination_compress 0, default_compress = 0
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000003
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000003(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031 to local backup:archive:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031.tmp to absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031, destination_path_create = true
-DEBUG: transferred 1 WAL segment(s), calling Archive->xfer() again
-DEBUG: File->manifest: db:absolute:[TEST_PATH]/backrest/archive/db/out
-DEBUG: no archive logs to be copied to backup
-DEBUG: transfer found 0 WAL segments - exiting
-DEBUG: safe exit called, terminating threads
+ INFO: archive-push start: --archive-async --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000003 asynchronously
+DEBUG: Archive->pushProcess(): bAsync = true, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000003
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->copy(): bAppendChecksum = true, bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 000000010000000100000003, strDestinationPathType = backup:archive:out, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000003, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000003.tmp, strSourcePathType = absolute
+DEBUG: Archive->pushProcess: no fork on archive local for TESTING
+DEBUG: Archive->pushProcess: start async archive-push
+DEBUG: Archive->xfer(): strArchivePath = [TEST_PATH]/backrest/archive/db/out, strStopFile = [TEST_PATH]/backrest/lock/db-archive.stop
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->manifest(): oManifestHashRef = [hash], strPath = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: File->manifestRecurse(): iDepth = 0, oManifestHashRef = [hash], strPathFileOp = [undef], strPathOp = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+ INFO: WAL segments to archive: total = 1, size = 16MB
+DEBUG: Archive->xfer: bArchiveFile = true, bDestinationCompress = false, bSourceCompressed = false, strFile = 000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strWalSegment = 000000010000000100000003, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000003
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000003(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = ()
+DEBUG: Archive->walFileName=>: strWalFileName = [undef]
+DEBUG: Archive->pushCheck=>: strArchiveId = 9.3-1, strChecksum = [undef]
+DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 9.3-1/000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = backup:archive, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031.tmp, strSourcePathType = absolute
+DEBUG: Archive->xfer=>: lFileTotal = 1
+DEBUG: Archive->pushProcess: transferred 1 WAL segment, calling Archive->xfer() again
+DEBUG: Archive->xfer(): strArchivePath = [TEST_PATH]/backrest/archive/db/out, strStopFile = [TEST_PATH]/backrest/lock/db-archive.stop
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->manifest(): oManifestHashRef = [hash], strPath = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: File->manifestRecurse(): iDepth = 0, oManifestHashRef = [hash], strPathFileOp = [undef], strPathOp = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: Archive->xfer: no WAL segments to archive
+DEBUG: Archive->pushProcess: transfer found 0 WAL segments - exiting
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000004
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000004 asynchronously
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000004 to local backup:archive:out:[TEST_PATH]/backrest/archive/db/out/000000010000000100000004, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000004.tmp to absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000004-1c7e00fd09b9dd11fc2966590b3e3274645dd031, destination_path_create = true
-DEBUG: No fork on archive local for TESTING
-DEBUG: starting async archive-push
-DEBUG: File->manifest: db:absolute:[TEST_PATH]/backrest/archive/db/out
- INFO: archive to be copied to backup total 1, size 16MB
-DEBUG: archive 000000010000000100000004-1c7e00fd09b9dd11fc2966590b3e3274645dd031, is WAL 1, source_compressed = 0, destination_compress 0, default_compress = 0
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000004
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000004(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000004-1c7e00fd09b9dd11fc2966590b3e3274645dd031 to local backup:archive:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000004-1c7e00fd09b9dd11fc2966590b3e3274645dd031, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000004-1c7e00fd09b9dd11fc2966590b3e3274645dd031.tmp to absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000004-1c7e00fd09b9dd11fc2966590b3e3274645dd031, destination_path_create = true
-DEBUG: transferred 1 WAL segment(s), calling Archive->xfer() again
-DEBUG: File->manifest: db:absolute:[TEST_PATH]/backrest/archive/db/out
-DEBUG: no archive logs to be copied to backup
-DEBUG: transfer found 0 WAL segments - exiting
-DEBUG: safe exit called, terminating threads
+ INFO: archive-push start: --archive-async --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000004 asynchronously
+DEBUG: Archive->pushProcess(): bAsync = true, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000004
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->copy(): bAppendChecksum = true, bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 000000010000000100000004, strDestinationPathType = backup:archive:out, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000004, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000004-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000004.tmp, strSourcePathType = absolute
+DEBUG: Archive->pushProcess: no fork on archive local for TESTING
+DEBUG: Archive->pushProcess: start async archive-push
+DEBUG: Archive->xfer(): strArchivePath = [TEST_PATH]/backrest/archive/db/out, strStopFile = [TEST_PATH]/backrest/lock/db-archive.stop
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->manifest(): oManifestHashRef = [hash], strPath = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: File->manifestRecurse(): iDepth = 0, oManifestHashRef = [hash], strPathFileOp = [undef], strPathOp = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+ INFO: WAL segments to archive: total = 1, size = 16MB
+DEBUG: Archive->xfer: bArchiveFile = true, bDestinationCompress = false, bSourceCompressed = false, strFile = 000000010000000100000004-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000004-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000004-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strWalSegment = 000000010000000100000004, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000004
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000004(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = ()
+DEBUG: Archive->walFileName=>: strWalFileName = [undef]
+DEBUG: Archive->pushCheck=>: strArchiveId = 9.3-1, strChecksum = [undef]
+DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 9.3-1/000000010000000100000004-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = backup:archive, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000004-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000004-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000004-1c7e00fd09b9dd11fc2966590b3e3274645dd031.tmp, strSourcePathType = absolute
+DEBUG: Archive->xfer=>: lFileTotal = 1
+DEBUG: Archive->pushProcess: transferred 1 WAL segment, calling Archive->xfer() again
+DEBUG: Archive->xfer(): strArchivePath = [TEST_PATH]/backrest/archive/db/out, strStopFile = [TEST_PATH]/backrest/lock/db-archive.stop
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->manifest(): oManifestHashRef = [hash], strPath = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: File->manifestRecurse(): iDepth = 0, oManifestHashRef = [hash], strPathFileOp = [undef], strPathOp = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: Archive->xfer: no WAL segments to archive
+DEBUG: Archive->pushProcess: transfer found 0 WAL segments - exiting
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000005 asynchronously
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000005 to local backup:archive:out:[TEST_PATH]/backrest/archive/db/out/000000010000000100000005, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000005.tmp to absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031, destination_path_create = true
-DEBUG: No fork on archive local for TESTING
-DEBUG: starting async archive-push
-DEBUG: File->manifest: db:absolute:[TEST_PATH]/backrest/archive/db/out
- INFO: archive to be copied to backup total 1, size 16MB
-DEBUG: archive 000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031, is WAL 1, source_compressed = 0, destination_compress 0, default_compress = 0
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000005
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000005(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031 to local backup:archive:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031.tmp to absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031, destination_path_create = true
-DEBUG: transferred 1 WAL segment(s), calling Archive->xfer() again
-DEBUG: File->manifest: db:absolute:[TEST_PATH]/backrest/archive/db/out
-DEBUG: no archive logs to be copied to backup
-DEBUG: transfer found 0 WAL segments - exiting
-DEBUG: safe exit called, terminating threads
+ INFO: archive-push start: --archive-async --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000005 asynchronously
+DEBUG: Archive->pushProcess(): bAsync = true, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->copy(): bAppendChecksum = true, bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 000000010000000100000005, strDestinationPathType = backup:archive:out, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000005.tmp, strSourcePathType = absolute
+DEBUG: Archive->pushProcess: no fork on archive local for TESTING
+DEBUG: Archive->pushProcess: start async archive-push
+DEBUG: Archive->xfer(): strArchivePath = [TEST_PATH]/backrest/archive/db/out, strStopFile = [TEST_PATH]/backrest/lock/db-archive.stop
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->manifest(): oManifestHashRef = [hash], strPath = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: File->manifestRecurse(): iDepth = 0, oManifestHashRef = [hash], strPathFileOp = [undef], strPathOp = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+ INFO: WAL segments to archive: total = 1, size = 16MB
+DEBUG: Archive->xfer: bArchiveFile = true, bDestinationCompress = false, bSourceCompressed = false, strFile = 000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strWalSegment = 000000010000000100000005, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000005
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000005(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = ()
+DEBUG: Archive->walFileName=>: strWalFileName = [undef]
+DEBUG: Archive->pushCheck=>: strArchiveId = 9.3-1, strChecksum = [undef]
+DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 9.3-1/000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = backup:archive, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031.tmp, strSourcePathType = absolute
+DEBUG: Archive->xfer=>: lFileTotal = 1
+DEBUG: Archive->pushProcess: transferred 1 WAL segment, calling Archive->xfer() again
+DEBUG: Archive->xfer(): strArchivePath = [TEST_PATH]/backrest/archive/db/out, strStopFile = [TEST_PATH]/backrest/lock/db-archive.stop
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->manifest(): oManifestHashRef = [hash], strPath = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: File->manifestRecurse(): iDepth = 0, oManifestHashRef = [hash], strPathFileOp = [undef], strPathOp = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: Archive->xfer: no WAL segments to archive
+DEBUG: Archive->pushProcess: transfer found 0 WAL segments - exiting
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000005 asynchronously
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000005 to local backup:archive:out:[TEST_PATH]/backrest/archive/db/out/000000010000000100000005, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000005.tmp to absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031, destination_path_create = true
-DEBUG: No fork on archive local for TESTING
-DEBUG: starting async archive-push
-DEBUG: File->manifest: db:absolute:[TEST_PATH]/backrest/archive/db/out
- INFO: archive to be copied to backup total 1, size 16MB
-DEBUG: archive 000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031, is WAL 1, source_compressed = 0, destination_compress 0, default_compress = 0
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000005
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
+ INFO: archive-push start: --archive-async --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000005 asynchronously
+DEBUG: Archive->pushProcess(): bAsync = true, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->copy(): bAppendChecksum = true, bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 000000010000000100000005, strDestinationPathType = backup:archive:out, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000005.tmp, strSourcePathType = absolute
+DEBUG: Archive->pushProcess: no fork on archive local for TESTING
+DEBUG: Archive->pushProcess: start async archive-push
+DEBUG: Archive->xfer(): strArchivePath = [TEST_PATH]/backrest/archive/db/out, strStopFile = [TEST_PATH]/backrest/lock/db-archive.stop
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->manifest(): oManifestHashRef = [hash], strPath = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: File->manifestRecurse(): iDepth = 0, oManifestHashRef = [hash], strPathFileOp = [undef], strPathOp = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+ INFO: WAL segments to archive: total = 1, size = 16MB
+DEBUG: Archive->xfer: bArchiveFile = true, bDestinationCompress = false, bSourceCompressed = false, strFile = 000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strWalSegment = 000000010000000100000005, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
ERROR: [119]: WAL segment version 9.3 does not match archive version 8.0
HINT: are you archiving to the correct stanza?
-DEBUG: safe exit called, terminating threads
+DEBUG: Main::safeExit(): iExitCode = 119
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000005 asynchronously
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000005 to local backup:archive:out:[TEST_PATH]/backrest/archive/db/out/000000010000000100000005, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000005.tmp to absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031, destination_path_create = true
-DEBUG: No fork on archive local for TESTING
-DEBUG: starting async archive-push
-DEBUG: File->manifest: db:absolute:[TEST_PATH]/backrest/archive/db/out
- INFO: archive to be copied to backup total 1, size 16MB
-DEBUG: archive 000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031, is WAL 1, source_compressed = 0, destination_compress 0, default_compress = 0
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000005
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
+ INFO: archive-push start: --archive-async --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000005 asynchronously
+DEBUG: Archive->pushProcess(): bAsync = true, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->copy(): bAppendChecksum = true, bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 000000010000000100000005, strDestinationPathType = backup:archive:out, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000005.tmp, strSourcePathType = absolute
+DEBUG: Archive->pushProcess: no fork on archive local for TESTING
+DEBUG: Archive->pushProcess: start async archive-push
+DEBUG: Archive->xfer(): strArchivePath = [TEST_PATH]/backrest/archive/db/out, strStopFile = [TEST_PATH]/backrest/lock/db-archive.stop
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->manifest(): oManifestHashRef = [hash], strPath = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: File->manifestRecurse(): iDepth = 0, oManifestHashRef = [hash], strPathFileOp = [undef], strPathOp = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+ INFO: WAL segments to archive: total = 1, size = 16MB
+DEBUG: Archive->xfer: bArchiveFile = true, bDestinationCompress = false, bSourceCompressed = false, strFile = 000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strWalSegment = 000000010000000100000005, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
ERROR: [119]: WAL segment system-id 5947969990501855219 does not match archive system-id 5000900090001855000
HINT: are you archiving to the correct stanza?
-DEBUG: safe exit called, terminating threads
+DEBUG: Main::safeExit(): iExitCode = 119
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000005 asynchronously
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000005 to local backup:archive:out:[TEST_PATH]/backrest/archive/db/out/000000010000000100000005, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000005.tmp to absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031, destination_path_create = true
-DEBUG: No fork on archive local for TESTING
-DEBUG: starting async archive-push
-DEBUG: File->manifest: db:absolute:[TEST_PATH]/backrest/archive/db/out
- INFO: archive to be copied to backup total 1, size 16MB
-DEBUG: archive 000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031, is WAL 1, source_compressed = 0, destination_compress 0, default_compress = 0
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000005
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000005(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->hash: db:absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031, compressed = false, hash_type = sha1
+ INFO: archive-push start: --archive-async --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000005 asynchronously
+DEBUG: Archive->pushProcess(): bAsync = true, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->copy(): bAppendChecksum = true, bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 000000010000000100000005, strDestinationPathType = backup:archive:out, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000005.tmp, strSourcePathType = absolute
+DEBUG: Archive->pushProcess: no fork on archive local for TESTING
+DEBUG: Archive->pushProcess: start async archive-push
+DEBUG: Archive->xfer(): strArchivePath = [TEST_PATH]/backrest/archive/db/out, strStopFile = [TEST_PATH]/backrest/lock/db-archive.stop
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->manifest(): oManifestHashRef = [hash], strPath = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: File->manifestRecurse(): iDepth = 0, oManifestHashRef = [hash], strPathFileOp = [undef], strPathOp = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+ INFO: WAL segments to archive: total = 1, size = 16MB
+DEBUG: Archive->xfer: bArchiveFile = true, bDestinationCompress = false, bSourceCompressed = false, strFile = 000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strWalSegment = 000000010000000100000005, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000005
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000005(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = (000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031)
+DEBUG: Archive->walFileName=>: strWalFileName = 000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: File->hash(): bCompressed = [undef], strFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strHashType = [undef], strPathType = db:absolute
+DEBUG: File->hashSize(): bCompressed = , strFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strHashType = , strPathType = db:absolute
+DEBUG: File->hashSize=>: iSize = 16777216, strHash = 1c7e00fd09b9dd11fc2966590b3e3274645dd031
WARN: WAL segment 000000010000000100000005 already exists in the archive with the same checksum
HINT: this is valid in some recovery scenarios but may also indicate a problem
-DEBUG: transferred 1 WAL segment(s), calling Archive->xfer() again
-DEBUG: File->manifest: db:absolute:[TEST_PATH]/backrest/archive/db/out
-DEBUG: no archive logs to be copied to backup
-DEBUG: transfer found 0 WAL segments - exiting
-DEBUG: safe exit called, terminating threads
+DEBUG: Archive->pushCheck=>: strArchiveId = 9.3-1, strChecksum = 1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->xfer=>: lFileTotal = 1
+DEBUG: Archive->pushProcess: transferred 1 WAL segment, calling Archive->xfer() again
+DEBUG: Archive->xfer(): strArchivePath = [TEST_PATH]/backrest/archive/db/out, strStopFile = [TEST_PATH]/backrest/lock/db-archive.stop
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->manifest(): oManifestHashRef = [hash], strPath = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: File->manifestRecurse(): iDepth = 0, oManifestHashRef = [hash], strPathFileOp = [undef], strPathOp = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: Archive->xfer: no WAL segments to archive
+DEBUG: Archive->pushProcess: transfer found 0 WAL segments - exiting
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000005 asynchronously
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000005 to local backup:archive:out:[TEST_PATH]/backrest/archive/db/out/000000010000000100000005, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000005.tmp to absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000005-4518a0fdf41d796760b384a358270d4682589820, destination_path_create = true
-DEBUG: No fork on archive local for TESTING
-DEBUG: starting async archive-push
-DEBUG: File->manifest: db:absolute:[TEST_PATH]/backrest/archive/db/out
- INFO: archive to be copied to backup total 1, size 16MB
-DEBUG: archive 000000010000000100000005-4518a0fdf41d796760b384a358270d4682589820, is WAL 1, source_compressed = 0, destination_compress 0, default_compress = 0
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000005
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000005(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->hash: db:absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000005-4518a0fdf41d796760b384a358270d4682589820, compressed = false, hash_type = sha1
+ INFO: archive-push start: --archive-async --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000005 asynchronously
+DEBUG: Archive->pushProcess(): bAsync = true, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->copy(): bAppendChecksum = true, bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 000000010000000100000005, strDestinationPathType = backup:archive:out, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000005-4518a0fdf41d796760b384a358270d4682589820, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000005.tmp, strSourcePathType = absolute
+DEBUG: Archive->pushProcess: no fork on archive local for TESTING
+DEBUG: Archive->pushProcess: start async archive-push
+DEBUG: Archive->xfer(): strArchivePath = [TEST_PATH]/backrest/archive/db/out, strStopFile = [TEST_PATH]/backrest/lock/db-archive.stop
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->manifest(): oManifestHashRef = [hash], strPath = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: File->manifestRecurse(): iDepth = 0, oManifestHashRef = [hash], strPathFileOp = [undef], strPathOp = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+ INFO: WAL segments to archive: total = 1, size = 16MB
+DEBUG: Archive->xfer: bArchiveFile = true, bDestinationCompress = false, bSourceCompressed = false, strFile = 000000010000000100000005-4518a0fdf41d796760b384a358270d4682589820
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000005-4518a0fdf41d796760b384a358270d4682589820
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000005-4518a0fdf41d796760b384a358270d4682589820, strWalSegment = 000000010000000100000005, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000005
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000005(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = (000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031)
+DEBUG: Archive->walFileName=>: strWalFileName = 000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: File->hash(): bCompressed = [undef], strFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000005-4518a0fdf41d796760b384a358270d4682589820, strHashType = [undef], strPathType = db:absolute
+DEBUG: File->hashSize(): bCompressed = , strFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000005-4518a0fdf41d796760b384a358270d4682589820, strHashType = , strPathType = db:absolute
+DEBUG: File->hashSize=>: iSize = 16777216, strHash = 4518a0fdf41d796760b384a358270d4682589820
ERROR: [120]: WAL segment 000000010000000100000005 already exists in the archive
-DEBUG: safe exit called, terminating threads
+DEBUG: Main::safeExit(): iExitCode = 120
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000006
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000006 asynchronously
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000006 to local backup:archive:out:[TEST_PATH]/backrest/archive/db/out/000000010000000100000006, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000006.tmp to absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000006-1c7e00fd09b9dd11fc2966590b3e3274645dd031, destination_path_create = true
-DEBUG: No fork on archive local for TESTING
-DEBUG: starting async archive-push
-DEBUG: File->manifest: db:absolute:[TEST_PATH]/backrest/archive/db/out
- INFO: archive to be copied to backup total 1, size 16MB
-DEBUG: archive 000000010000000100000006-1c7e00fd09b9dd11fc2966590b3e3274645dd031, is WAL 1, source_compressed = 0, destination_compress 0, default_compress = 0
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000006
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000006(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000006-1c7e00fd09b9dd11fc2966590b3e3274645dd031 to local backup:archive:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000006-1c7e00fd09b9dd11fc2966590b3e3274645dd031, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000006-1c7e00fd09b9dd11fc2966590b3e3274645dd031.tmp to absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000006-1c7e00fd09b9dd11fc2966590b3e3274645dd031, destination_path_create = true
-DEBUG: transferred 1 WAL segment(s), calling Archive->xfer() again
-DEBUG: File->manifest: db:absolute:[TEST_PATH]/backrest/archive/db/out
-DEBUG: no archive logs to be copied to backup
-DEBUG: transfer found 0 WAL segments - exiting
-DEBUG: safe exit called, terminating threads
+ INFO: archive-push start: --archive-async --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000006 asynchronously
+DEBUG: Archive->pushProcess(): bAsync = true, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000006
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->copy(): bAppendChecksum = true, bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 000000010000000100000006, strDestinationPathType = backup:archive:out, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000006, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000006-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000006.tmp, strSourcePathType = absolute
+DEBUG: Archive->pushProcess: no fork on archive local for TESTING
+DEBUG: Archive->pushProcess: start async archive-push
+DEBUG: Archive->xfer(): strArchivePath = [TEST_PATH]/backrest/archive/db/out, strStopFile = [TEST_PATH]/backrest/lock/db-archive.stop
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->manifest(): oManifestHashRef = [hash], strPath = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: File->manifestRecurse(): iDepth = 0, oManifestHashRef = [hash], strPathFileOp = [undef], strPathOp = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+ INFO: WAL segments to archive: total = 1, size = 16MB
+DEBUG: Archive->xfer: bArchiveFile = true, bDestinationCompress = false, bSourceCompressed = false, strFile = 000000010000000100000006-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000006-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000006-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strWalSegment = 000000010000000100000006, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000006
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000006(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = ()
+DEBUG: Archive->walFileName=>: strWalFileName = [undef]
+DEBUG: Archive->pushCheck=>: strArchiveId = 9.3-1, strChecksum = [undef]
+DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 9.3-1/000000010000000100000006-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = backup:archive, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000006-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000006-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000006-1c7e00fd09b9dd11fc2966590b3e3274645dd031.tmp, strSourcePathType = absolute
+DEBUG: Archive->xfer=>: lFileTotal = 1
+DEBUG: Archive->pushProcess: transferred 1 WAL segment, calling Archive->xfer() again
+DEBUG: Archive->xfer(): strArchivePath = [TEST_PATH]/backrest/archive/db/out, strStopFile = [TEST_PATH]/backrest/lock/db-archive.stop
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->manifest(): oManifestHashRef = [hash], strPath = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: File->manifestRecurse(): iDepth = 0, oManifestHashRef = [hash], strPathFileOp = [undef], strPathOp = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: Archive->xfer: no WAL segments to archive
+DEBUG: Archive->pushProcess: transfer found 0 WAL segments - exiting
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000007
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000007 asynchronously
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000007 to local backup:archive:out:[TEST_PATH]/backrest/archive/db/out/000000010000000100000007, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000007.tmp to absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000007-1c7e00fd09b9dd11fc2966590b3e3274645dd031, destination_path_create = true
-DEBUG: No fork on archive local for TESTING
-DEBUG: starting async archive-push
-DEBUG: File->manifest: db:absolute:[TEST_PATH]/backrest/archive/db/out
- INFO: archive to be copied to backup total 1, size 16MB
-DEBUG: archive 000000010000000100000007-1c7e00fd09b9dd11fc2966590b3e3274645dd031, is WAL 1, source_compressed = 0, destination_compress 0, default_compress = 0
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000007
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000007(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000007-1c7e00fd09b9dd11fc2966590b3e3274645dd031 to local backup:archive:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000007-1c7e00fd09b9dd11fc2966590b3e3274645dd031, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000007-1c7e00fd09b9dd11fc2966590b3e3274645dd031.tmp to absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000007-1c7e00fd09b9dd11fc2966590b3e3274645dd031, destination_path_create = true
-DEBUG: transferred 1 WAL segment(s), calling Archive->xfer() again
-DEBUG: File->manifest: db:absolute:[TEST_PATH]/backrest/archive/db/out
-DEBUG: no archive logs to be copied to backup
-DEBUG: transfer found 0 WAL segments - exiting
-DEBUG: safe exit called, terminating threads
+ INFO: archive-push start: --archive-async --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000007 asynchronously
+DEBUG: Archive->pushProcess(): bAsync = true, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000007
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->copy(): bAppendChecksum = true, bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 000000010000000100000007, strDestinationPathType = backup:archive:out, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000007, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000007-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000007.tmp, strSourcePathType = absolute
+DEBUG: Archive->pushProcess: no fork on archive local for TESTING
+DEBUG: Archive->pushProcess: start async archive-push
+DEBUG: Archive->xfer(): strArchivePath = [TEST_PATH]/backrest/archive/db/out, strStopFile = [TEST_PATH]/backrest/lock/db-archive.stop
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->manifest(): oManifestHashRef = [hash], strPath = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: File->manifestRecurse(): iDepth = 0, oManifestHashRef = [hash], strPathFileOp = [undef], strPathOp = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+ INFO: WAL segments to archive: total = 1, size = 16MB
+DEBUG: Archive->xfer: bArchiveFile = true, bDestinationCompress = false, bSourceCompressed = false, strFile = 000000010000000100000007-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000007-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000007-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strWalSegment = 000000010000000100000007, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000007
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000007(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = ()
+DEBUG: Archive->walFileName=>: strWalFileName = [undef]
+DEBUG: Archive->pushCheck=>: strArchiveId = 9.3-1, strChecksum = [undef]
+DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 9.3-1/000000010000000100000007-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = backup:archive, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000007-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000007-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000007-1c7e00fd09b9dd11fc2966590b3e3274645dd031.tmp, strSourcePathType = absolute
+DEBUG: Archive->xfer=>: lFileTotal = 1
+DEBUG: Archive->pushProcess: transferred 1 WAL segment, calling Archive->xfer() again
+DEBUG: Archive->xfer(): strArchivePath = [TEST_PATH]/backrest/archive/db/out, strStopFile = [TEST_PATH]/backrest/lock/db-archive.stop
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->manifest(): oManifestHashRef = [hash], strPath = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: File->manifestRecurse(): iDepth = 0, oManifestHashRef = [hash], strPathFileOp = [undef], strPathOp = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: Archive->xfer: no WAL segments to archive
+DEBUG: Archive->pushProcess: transfer found 0 WAL segments - exiting
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000008
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000008 asynchronously
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000008 to local backup:archive:out:[TEST_PATH]/backrest/archive/db/out/000000010000000100000008, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000008.tmp to absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000008-1c7e00fd09b9dd11fc2966590b3e3274645dd031, destination_path_create = true
-DEBUG: No fork on archive local for TESTING
-DEBUG: starting async archive-push
-DEBUG: File->manifest: db:absolute:[TEST_PATH]/backrest/archive/db/out
- INFO: archive to be copied to backup total 1, size 16MB
-DEBUG: archive 000000010000000100000008-1c7e00fd09b9dd11fc2966590b3e3274645dd031, is WAL 1, source_compressed = 0, destination_compress 0, default_compress = 0
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000008
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000008(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000008-1c7e00fd09b9dd11fc2966590b3e3274645dd031 to local backup:archive:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000008-1c7e00fd09b9dd11fc2966590b3e3274645dd031, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000008-1c7e00fd09b9dd11fc2966590b3e3274645dd031.tmp to absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000008-1c7e00fd09b9dd11fc2966590b3e3274645dd031, destination_path_create = true
-DEBUG: transferred 1 WAL segment(s), calling Archive->xfer() again
-DEBUG: File->manifest: db:absolute:[TEST_PATH]/backrest/archive/db/out
-DEBUG: no archive logs to be copied to backup
-DEBUG: transfer found 0 WAL segments - exiting
-DEBUG: safe exit called, terminating threads
+ INFO: archive-push start: --archive-async --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000008 asynchronously
+DEBUG: Archive->pushProcess(): bAsync = true, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000008
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->copy(): bAppendChecksum = true, bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 000000010000000100000008, strDestinationPathType = backup:archive:out, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000008, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000008-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000008.tmp, strSourcePathType = absolute
+DEBUG: Archive->pushProcess: no fork on archive local for TESTING
+DEBUG: Archive->pushProcess: start async archive-push
+DEBUG: Archive->xfer(): strArchivePath = [TEST_PATH]/backrest/archive/db/out, strStopFile = [TEST_PATH]/backrest/lock/db-archive.stop
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->manifest(): oManifestHashRef = [hash], strPath = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: File->manifestRecurse(): iDepth = 0, oManifestHashRef = [hash], strPathFileOp = [undef], strPathOp = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+ INFO: WAL segments to archive: total = 1, size = 16MB
+DEBUG: Archive->xfer: bArchiveFile = true, bDestinationCompress = false, bSourceCompressed = false, strFile = 000000010000000100000008-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000008-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000008-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strWalSegment = 000000010000000100000008, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000008
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000008(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = ()
+DEBUG: Archive->walFileName=>: strWalFileName = [undef]
+DEBUG: Archive->pushCheck=>: strArchiveId = 9.3-1, strChecksum = [undef]
+DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 9.3-1/000000010000000100000008-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = backup:archive, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000008-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000008-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000008-1c7e00fd09b9dd11fc2966590b3e3274645dd031.tmp, strSourcePathType = absolute
+DEBUG: Archive->xfer=>: lFileTotal = 1
+DEBUG: Archive->pushProcess: transferred 1 WAL segment, calling Archive->xfer() again
+DEBUG: Archive->xfer(): strArchivePath = [TEST_PATH]/backrest/archive/db/out, strStopFile = [TEST_PATH]/backrest/lock/db-archive.stop
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->manifest(): oManifestHashRef = [hash], strPath = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: File->manifestRecurse(): iDepth = 0, oManifestHashRef = [hash], strPathFileOp = [undef], strPathOp = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: Archive->xfer: no WAL segments to archive
+DEBUG: Archive->pushProcess: transfer found 0 WAL segments - exiting
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000009
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000009 asynchronously
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000009 to local backup:archive:out:[TEST_PATH]/backrest/archive/db/out/000000010000000100000009, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000009.tmp to absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031, destination_path_create = true
-DEBUG: No fork on archive local for TESTING
-DEBUG: starting async archive-push
-DEBUG: File->manifest: db:absolute:[TEST_PATH]/backrest/archive/db/out
- INFO: archive to be copied to backup total 1, size 16MB
-DEBUG: archive 000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031, is WAL 1, source_compressed = 0, destination_compress 0, default_compress = 0
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000009
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000009(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031 to local backup:archive:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031.tmp to absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031, destination_path_create = true
-DEBUG: transferred 1 WAL segment(s), calling Archive->xfer() again
-DEBUG: File->manifest: db:absolute:[TEST_PATH]/backrest/archive/db/out
-DEBUG: no archive logs to be copied to backup
-DEBUG: transfer found 0 WAL segments - exiting
-DEBUG: safe exit called, terminating threads
+ INFO: archive-push start: --archive-async --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000009 asynchronously
+DEBUG: Archive->pushProcess(): bAsync = true, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000009
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->copy(): bAppendChecksum = true, bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 000000010000000100000009, strDestinationPathType = backup:archive:out, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000009, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000009.tmp, strSourcePathType = absolute
+DEBUG: Archive->pushProcess: no fork on archive local for TESTING
+DEBUG: Archive->pushProcess: start async archive-push
+DEBUG: Archive->xfer(): strArchivePath = [TEST_PATH]/backrest/archive/db/out, strStopFile = [TEST_PATH]/backrest/lock/db-archive.stop
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->manifest(): oManifestHashRef = [hash], strPath = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: File->manifestRecurse(): iDepth = 0, oManifestHashRef = [hash], strPathFileOp = [undef], strPathOp = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+ INFO: WAL segments to archive: total = 1, size = 16MB
+DEBUG: Archive->xfer: bArchiveFile = true, bDestinationCompress = false, bSourceCompressed = false, strFile = 000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strWalSegment = 000000010000000100000009, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000009
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000009(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = ()
+DEBUG: Archive->walFileName=>: strWalFileName = [undef]
+DEBUG: Archive->pushCheck=>: strArchiveId = 9.3-1, strChecksum = [undef]
+DEBUG: File->copy(): bAppendChecksum = , bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 9.3-1/000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = backup:archive, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031.tmp, strSourcePathType = absolute
+DEBUG: Archive->xfer=>: lFileTotal = 1
+DEBUG: Archive->pushProcess: transferred 1 WAL segment, calling Archive->xfer() again
+DEBUG: Archive->xfer(): strArchivePath = [TEST_PATH]/backrest/archive/db/out, strStopFile = [TEST_PATH]/backrest/lock/db-archive.stop
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->manifest(): oManifestHashRef = [hash], strPath = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: File->manifestRecurse(): iDepth = 0, oManifestHashRef = [hash], strPathFileOp = [undef], strPathOp = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: Archive->xfer: no WAL segments to archive
+DEBUG: Archive->pushProcess: transfer found 0 WAL segments - exiting
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000009
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000009 asynchronously
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000009 to local backup:archive:out:[TEST_PATH]/backrest/archive/db/out/000000010000000100000009, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000009.tmp to absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031, destination_path_create = true
-DEBUG: No fork on archive local for TESTING
-DEBUG: starting async archive-push
-DEBUG: File->manifest: db:absolute:[TEST_PATH]/backrest/archive/db/out
- INFO: archive to be copied to backup total 1, size 16MB
-DEBUG: archive 000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031, is WAL 1, source_compressed = 0, destination_compress 0, default_compress = 0
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000009
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
+ INFO: archive-push start: --archive-async --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000009 asynchronously
+DEBUG: Archive->pushProcess(): bAsync = true, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000009
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->copy(): bAppendChecksum = true, bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 000000010000000100000009, strDestinationPathType = backup:archive:out, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000009, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000009.tmp, strSourcePathType = absolute
+DEBUG: Archive->pushProcess: no fork on archive local for TESTING
+DEBUG: Archive->pushProcess: start async archive-push
+DEBUG: Archive->xfer(): strArchivePath = [TEST_PATH]/backrest/archive/db/out, strStopFile = [TEST_PATH]/backrest/lock/db-archive.stop
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->manifest(): oManifestHashRef = [hash], strPath = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: File->manifestRecurse(): iDepth = 0, oManifestHashRef = [hash], strPathFileOp = [undef], strPathOp = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+ INFO: WAL segments to archive: total = 1, size = 16MB
+DEBUG: Archive->xfer: bArchiveFile = true, bDestinationCompress = false, bSourceCompressed = false, strFile = 000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strWalSegment = 000000010000000100000009, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
ERROR: [119]: WAL segment version 9.3 does not match archive version 8.0
HINT: are you archiving to the correct stanza?
-DEBUG: safe exit called, terminating threads
+DEBUG: Main::safeExit(): iExitCode = 119
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000009
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000009 asynchronously
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000009 to local backup:archive:out:[TEST_PATH]/backrest/archive/db/out/000000010000000100000009, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000009.tmp to absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031, destination_path_create = true
-DEBUG: No fork on archive local for TESTING
-DEBUG: starting async archive-push
-DEBUG: File->manifest: db:absolute:[TEST_PATH]/backrest/archive/db/out
- INFO: archive to be copied to backup total 1, size 16MB
-DEBUG: archive 000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031, is WAL 1, source_compressed = 0, destination_compress 0, default_compress = 0
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000009
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
+ INFO: archive-push start: --archive-async --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000009 asynchronously
+DEBUG: Archive->pushProcess(): bAsync = true, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000009
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->copy(): bAppendChecksum = true, bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 000000010000000100000009, strDestinationPathType = backup:archive:out, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000009, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000009.tmp, strSourcePathType = absolute
+DEBUG: Archive->pushProcess: no fork on archive local for TESTING
+DEBUG: Archive->pushProcess: start async archive-push
+DEBUG: Archive->xfer(): strArchivePath = [TEST_PATH]/backrest/archive/db/out, strStopFile = [TEST_PATH]/backrest/lock/db-archive.stop
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->manifest(): oManifestHashRef = [hash], strPath = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: File->manifestRecurse(): iDepth = 0, oManifestHashRef = [hash], strPathFileOp = [undef], strPathOp = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+ INFO: WAL segments to archive: total = 1, size = 16MB
+DEBUG: Archive->xfer: bArchiveFile = true, bDestinationCompress = false, bSourceCompressed = false, strFile = 000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strWalSegment = 000000010000000100000009, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
ERROR: [119]: WAL segment system-id 5947969990501855219 does not match archive system-id 5000900090001855000
HINT: are you archiving to the correct stanza?
-DEBUG: safe exit called, terminating threads
+DEBUG: Main::safeExit(): iExitCode = 119
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000009
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000009 asynchronously
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000009 to local backup:archive:out:[TEST_PATH]/backrest/archive/db/out/000000010000000100000009, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000009.tmp to absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031, destination_path_create = true
-DEBUG: No fork on archive local for TESTING
-DEBUG: starting async archive-push
-DEBUG: File->manifest: db:absolute:[TEST_PATH]/backrest/archive/db/out
- INFO: archive to be copied to backup total 1, size 16MB
-DEBUG: archive 000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031, is WAL 1, source_compressed = 0, destination_compress 0, default_compress = 0
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000009
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000009(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->hash: db:absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031, compressed = false, hash_type = sha1
+ INFO: archive-push start: --archive-async --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000009 asynchronously
+DEBUG: Archive->pushProcess(): bAsync = true, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000009
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->copy(): bAppendChecksum = true, bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 000000010000000100000009, strDestinationPathType = backup:archive:out, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000009, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000009.tmp, strSourcePathType = absolute
+DEBUG: Archive->pushProcess: no fork on archive local for TESTING
+DEBUG: Archive->pushProcess: start async archive-push
+DEBUG: Archive->xfer(): strArchivePath = [TEST_PATH]/backrest/archive/db/out, strStopFile = [TEST_PATH]/backrest/lock/db-archive.stop
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->manifest(): oManifestHashRef = [hash], strPath = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: File->manifestRecurse(): iDepth = 0, oManifestHashRef = [hash], strPathFileOp = [undef], strPathOp = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+ INFO: WAL segments to archive: total = 1, size = 16MB
+DEBUG: Archive->xfer: bArchiveFile = true, bDestinationCompress = false, bSourceCompressed = false, strFile = 000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strWalSegment = 000000010000000100000009, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000009
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000009(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = (000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031)
+DEBUG: Archive->walFileName=>: strWalFileName = 000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: File->hash(): bCompressed = [undef], strFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strHashType = [undef], strPathType = db:absolute
+DEBUG: File->hashSize(): bCompressed = , strFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031, strHashType = , strPathType = db:absolute
+DEBUG: File->hashSize=>: iSize = 16777216, strHash = 1c7e00fd09b9dd11fc2966590b3e3274645dd031
WARN: WAL segment 000000010000000100000009 already exists in the archive with the same checksum
HINT: this is valid in some recovery scenarios but may also indicate a problem
-DEBUG: transferred 1 WAL segment(s), calling Archive->xfer() again
-DEBUG: File->manifest: db:absolute:[TEST_PATH]/backrest/archive/db/out
-DEBUG: no archive logs to be copied to backup
-DEBUG: transfer found 0 WAL segments - exiting
-DEBUG: safe exit called, terminating threads
+DEBUG: Archive->pushCheck=>: strArchiveId = 9.3-1, strChecksum = 1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Archive->xfer=>: lFileTotal = 1
+DEBUG: Archive->pushProcess: transferred 1 WAL segment, calling Archive->xfer() again
+DEBUG: Archive->xfer(): strArchivePath = [TEST_PATH]/backrest/archive/db/out, strStopFile = [TEST_PATH]/backrest/lock/db-archive.stop
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->manifest(): oManifestHashRef = [hash], strPath = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: File->manifestRecurse(): iDepth = 0, oManifestHashRef = [hash], strPathFileOp = [undef], strPathOp = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: Archive->xfer: no WAL segments to archive
+DEBUG: Archive->pushProcess: transfer found 0 WAL segments - exiting
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000009
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000009 asynchronously
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000009 to local backup:archive:out:[TEST_PATH]/backrest/archive/db/out/000000010000000100000009, source_compressed = false, destination_compress = false, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000009.tmp to absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000009-4518a0fdf41d796760b384a358270d4682589820, destination_path_create = true
-DEBUG: No fork on archive local for TESTING
-DEBUG: starting async archive-push
-DEBUG: File->manifest: db:absolute:[TEST_PATH]/backrest/archive/db/out
- INFO: archive to be copied to backup total 1, size 16MB
-DEBUG: archive 000000010000000100000009-4518a0fdf41d796760b384a358270d4682589820, is WAL 1, source_compressed = 0, destination_compress 0, default_compress = 0
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000009
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000009(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->hash: db:absolute:[TEST_PATH]/backrest/archive/db/out/000000010000000100000009-4518a0fdf41d796760b384a358270d4682589820, compressed = false, hash_type = sha1
+ INFO: archive-push start: --archive-async --no-compress --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000009 asynchronously
+DEBUG: Archive->pushProcess(): bAsync = true, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000009
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->copy(): bAppendChecksum = true, bDestinationCompress = false, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 000000010000000100000009, strDestinationPathType = backup:archive:out, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000009, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000009-4518a0fdf41d796760b384a358270d4682589820, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000009.tmp, strSourcePathType = absolute
+DEBUG: Archive->pushProcess: no fork on archive local for TESTING
+DEBUG: Archive->pushProcess: start async archive-push
+DEBUG: Archive->xfer(): strArchivePath = [TEST_PATH]/backrest/archive/db/out, strStopFile = [TEST_PATH]/backrest/lock/db-archive.stop
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: File->manifest(): oManifestHashRef = [hash], strPath = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+DEBUG: File->manifestRecurse(): iDepth = 0, oManifestHashRef = [hash], strPathFileOp = [undef], strPathOp = [TEST_PATH]/backrest/archive/db/out, strPathType = db:absolute
+ INFO: WAL segments to archive: total = 1, size = 16MB
+DEBUG: Archive->xfer: bArchiveFile = true, bDestinationCompress = false, bSourceCompressed = false, strFile = 000000010000000100000009-4518a0fdf41d796760b384a358270d4682589820
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000009-4518a0fdf41d796760b384a358270d4682589820
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000009-4518a0fdf41d796760b384a358270d4682589820, strWalSegment = 000000010000000100000009, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000009
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000009(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = (000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031)
+DEBUG: Archive->walFileName=>: strWalFileName = 000000010000000100000009-1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: File->hash(): bCompressed = [undef], strFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000009-4518a0fdf41d796760b384a358270d4682589820, strHashType = [undef], strPathType = db:absolute
+DEBUG: File->hashSize(): bCompressed = , strFile = [TEST_PATH]/backrest/archive/db/out/000000010000000100000009-4518a0fdf41d796760b384a358270d4682589820, strHashType = , strPathType = db:absolute
+DEBUG: File->hashSize=>: iSize = 16777216, strHash = 4518a0fdf41d796760b384a358270d4682589820
ERROR: [120]: WAL segment 000000010000000100000009 already exists in the archive
-DEBUG: safe exit called, terminating threads
+DEBUG: Main::safeExit(): iExitCode = 120
+ INFO: archive-push stop
+ supplemental file: [TEST_PATH]/backrest/archive/db/archive.info
-----------------------------------------------------------------
diff --git a/test/log/backup-archive-push-003.log b/test/log/backup-archive-push-003.log
index 0045e70a1..0c2e82d95 100644
--- a/test/log/backup-archive-push-003.log
+++ b/test/log/backup-archive-push-003.log
@@ -3,235 +3,503 @@ run 003 - rmt 0, cmp 1, arc_async 0
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000001
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: File->path_create: backup:archive:[TEST_PATH]/backrest/archive/db, mode 0750
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000001(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->exists: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000001 to local backup:archive:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000001.gz, source_compressed = false, destination_compress = true, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->path_create: absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, mode 0750
-DEBUG: File->exists: absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000001.gz.tmp to absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz, destination_path_create = true
-DEBUG: safe exit called, terminating threads
+ INFO: archive-push start: --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
+DEBUG: Archive->pushProcess(): bAsync = false, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strWalSegment = 000000010000000100000001, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = false
+DEBUG: File->pathCreate(): bIgnoreExists = , strMode = <0750>, strPath = [undef], strPathType = backup:archive
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000001
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000001(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->exists(): strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute
+DEBUG: File->exists=>: bExists = false
+DEBUG: Archive->walFileName=>: strWalFileName = [undef]
+DEBUG: Archive->pushCheck=>: strArchiveId = 9.3-1, strChecksum = [undef]
+DEBUG: File->copy(): bAppendChecksum = true, bDestinationCompress = true, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 9.3-1/000000010000000100000001.gz, strDestinationPathType = backup:archive, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->pathCreate(): bIgnoreExists = true, strMode = <0750>, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = absolute
+DEBUG: File->exists(): strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = absolute
+DEBUG: File->exists=>: bExists = false
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000001.gz.tmp, strSourcePathType = absolute
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000001
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
+ INFO: archive-push start: --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
+DEBUG: Archive->pushProcess(): bAsync = false, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strWalSegment = 000000010000000100000001, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
ERROR: [119]: WAL segment version 9.3 does not match archive version 8.0
HINT: are you archiving to the correct stanza?
-DEBUG: safe exit called, terminating threads
+DEBUG: Main::safeExit(): iExitCode = 119
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000001
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
+ INFO: archive-push start: --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
+DEBUG: Archive->pushProcess(): bAsync = false, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strWalSegment = 000000010000000100000001, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
ERROR: [119]: WAL segment system-id 5947969990501855219 does not match archive system-id 5000900090001855000
HINT: are you archiving to the correct stanza?
-DEBUG: safe exit called, terminating threads
+DEBUG: Main::safeExit(): iExitCode = 119
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000001
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000001(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->hash: db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000001, compressed = false, hash_type = sha1
+ INFO: archive-push start: --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
+DEBUG: Archive->pushProcess(): bAsync = false, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strWalSegment = 000000010000000100000001, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000001
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000001(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = (000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz)
+DEBUG: Archive->walFileName=>: strWalFileName = 000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz
+DEBUG: File->hash(): bCompressed = [undef], strFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strHashType = [undef], strPathType = db:absolute
+DEBUG: File->hashSize(): bCompressed = , strFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strHashType = , strPathType = db:absolute
+DEBUG: File->hashSize=>: iSize = 16777216, strHash = 1c7e00fd09b9dd11fc2966590b3e3274645dd031
WARN: WAL segment 000000010000000100000001 already exists in the archive with the same checksum
HINT: this is valid in some recovery scenarios but may also indicate a problem
-DEBUG: safe exit called, terminating threads
+DEBUG: Archive->pushCheck=>: strArchiveId = 9.3-1, strChecksum = 1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000001
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000001(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->hash: db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000001, compressed = false, hash_type = sha1
+ INFO: archive-push start: --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
+DEBUG: Archive->pushProcess(): bAsync = false, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strWalSegment = 000000010000000100000001, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000001
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000001(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = (000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz)
+DEBUG: Archive->walFileName=>: strWalFileName = 000000010000000100000001-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz
+DEBUG: File->hash(): bCompressed = [undef], strFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strHashType = [undef], strPathType = db:absolute
+DEBUG: File->hashSize(): bCompressed = , strFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000001, strHashType = , strPathType = db:absolute
+DEBUG: File->hashSize=>: iSize = 16777216, strHash = 4518a0fdf41d796760b384a358270d4682589820
ERROR: [120]: WAL segment 000000010000000100000001 already exists in the archive
-DEBUG: safe exit called, terminating threads
+DEBUG: Main::safeExit(): iExitCode = 120
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000002
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000002
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000002
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000002(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000002 to local backup:archive:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000002.gz, source_compressed = false, destination_compress = true, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000002.gz.tmp to absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz, destination_path_create = true
-DEBUG: safe exit called, terminating threads
+ INFO: archive-push start: --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000002
+DEBUG: Archive->pushProcess(): bAsync = false, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000002
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000002
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000002, strWalSegment = 000000010000000100000002, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000002
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000002(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = ()
+DEBUG: Archive->walFileName=>: strWalFileName = [undef]
+DEBUG: Archive->pushCheck=>: strArchiveId = 9.3-1, strChecksum = [undef]
+DEBUG: File->copy(): bAppendChecksum = true, bDestinationCompress = true, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 9.3-1/000000010000000100000002.gz, strDestinationPathType = backup:archive, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000002, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000002-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000002.gz.tmp, strSourcePathType = absolute
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000003
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000003
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000003
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000003(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000003 to local backup:archive:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000003.gz, source_compressed = false, destination_compress = true, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000003.gz.tmp to absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz, destination_path_create = true
-DEBUG: safe exit called, terminating threads
+ INFO: archive-push start: --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000003
+DEBUG: Archive->pushProcess(): bAsync = false, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000003
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000003
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000003, strWalSegment = 000000010000000100000003, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000003
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000003(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = ()
+DEBUG: Archive->walFileName=>: strWalFileName = [undef]
+DEBUG: Archive->pushCheck=>: strArchiveId = 9.3-1, strChecksum = [undef]
+DEBUG: File->copy(): bAppendChecksum = true, bDestinationCompress = true, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 9.3-1/000000010000000100000003.gz, strDestinationPathType = backup:archive, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000003, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000003-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000003.gz.tmp, strSourcePathType = absolute
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000004
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000004
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000004
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000004(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000004 to local backup:archive:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000004.gz, source_compressed = false, destination_compress = true, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000004.gz.tmp to absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000004-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz, destination_path_create = true
-DEBUG: safe exit called, terminating threads
+ INFO: archive-push start: --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000004
+DEBUG: Archive->pushProcess(): bAsync = false, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000004
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000004
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000004, strWalSegment = 000000010000000100000004, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000004
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000004(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = ()
+DEBUG: Archive->walFileName=>: strWalFileName = [undef]
+DEBUG: Archive->pushCheck=>: strArchiveId = 9.3-1, strChecksum = [undef]
+DEBUG: File->copy(): bAppendChecksum = true, bDestinationCompress = true, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 9.3-1/000000010000000100000004.gz, strDestinationPathType = backup:archive, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000004, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000004-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000004.gz.tmp, strSourcePathType = absolute
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000005
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000005(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000005 to local backup:archive:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000005.gz, source_compressed = false, destination_compress = true, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000005.gz.tmp to absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz, destination_path_create = true
-DEBUG: safe exit called, terminating threads
+ INFO: archive-push start: --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
+DEBUG: Archive->pushProcess(): bAsync = false, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005, strWalSegment = 000000010000000100000005, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000005
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000005(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = ()
+DEBUG: Archive->walFileName=>: strWalFileName = [undef]
+DEBUG: Archive->pushCheck=>: strArchiveId = 9.3-1, strChecksum = [undef]
+DEBUG: File->copy(): bAppendChecksum = true, bDestinationCompress = true, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 9.3-1/000000010000000100000005.gz, strDestinationPathType = backup:archive, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000005.gz.tmp, strSourcePathType = absolute
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000005
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
+ INFO: archive-push start: --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
+DEBUG: Archive->pushProcess(): bAsync = false, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005, strWalSegment = 000000010000000100000005, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
ERROR: [119]: WAL segment version 9.3 does not match archive version 8.0
HINT: are you archiving to the correct stanza?
-DEBUG: safe exit called, terminating threads
+DEBUG: Main::safeExit(): iExitCode = 119
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000005
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
+ INFO: archive-push start: --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
+DEBUG: Archive->pushProcess(): bAsync = false, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005, strWalSegment = 000000010000000100000005, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
ERROR: [119]: WAL segment system-id 5947969990501855219 does not match archive system-id 5000900090001855000
HINT: are you archiving to the correct stanza?
-DEBUG: safe exit called, terminating threads
+DEBUG: Main::safeExit(): iExitCode = 119
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000005
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000005(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->hash: db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000005, compressed = false, hash_type = sha1
+ INFO: archive-push start: --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
+DEBUG: Archive->pushProcess(): bAsync = false, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005, strWalSegment = 000000010000000100000005, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000005
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000005(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = (000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz)
+DEBUG: Archive->walFileName=>: strWalFileName = 000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz
+DEBUG: File->hash(): bCompressed = [undef], strFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005, strHashType = [undef], strPathType = db:absolute
+DEBUG: File->hashSize(): bCompressed = , strFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005, strHashType = , strPathType = db:absolute
+DEBUG: File->hashSize=>: iSize = 16777216, strHash = 1c7e00fd09b9dd11fc2966590b3e3274645dd031
WARN: WAL segment 000000010000000100000005 already exists in the archive with the same checksum
HINT: this is valid in some recovery scenarios but may also indicate a problem
-DEBUG: safe exit called, terminating threads
+DEBUG: Archive->pushCheck=>: strArchiveId = 9.3-1, strChecksum = 1c7e00fd09b9dd11fc2966590b3e3274645dd031
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000005
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000005(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->hash: db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000005, compressed = false, hash_type = sha1
+ INFO: archive-push start: --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
+DEBUG: Archive->pushProcess(): bAsync = false, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005, strWalSegment = 000000010000000100000005, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000005
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000005(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = (000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz)
+DEBUG: Archive->walFileName=>: strWalFileName = 000000010000000100000005-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz
+DEBUG: File->hash(): bCompressed = [undef], strFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005, strHashType = [undef], strPathType = db:absolute
+DEBUG: File->hashSize(): bCompressed = , strFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000005, strHashType = , strPathType = db:absolute
+DEBUG: File->hashSize=>: iSize = 16777216, strHash = 4518a0fdf41d796760b384a358270d4682589820
ERROR: [120]: WAL segment 000000010000000100000005 already exists in the archive
-DEBUG: safe exit called, terminating threads
+DEBUG: Main::safeExit(): iExitCode = 120
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000006
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000006
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000006
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000006(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000006 to local backup:archive:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000006.gz, source_compressed = false, destination_compress = true, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000006.gz.tmp to absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000006-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz, destination_path_create = true
-DEBUG: safe exit called, terminating threads
+ INFO: archive-push start: --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000006
+DEBUG: Archive->pushProcess(): bAsync = false, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000006
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000006
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000006, strWalSegment = 000000010000000100000006, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000006
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000006(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = ()
+DEBUG: Archive->walFileName=>: strWalFileName = [undef]
+DEBUG: Archive->pushCheck=>: strArchiveId = 9.3-1, strChecksum = [undef]
+DEBUG: File->copy(): bAppendChecksum = true, bDestinationCompress = true, bDestinationPathCreate = true, bIgnoreMissingSource = , bSourceCompressed = false, lModificationTime = [undef], strDestinationFile = 9.3-1/000000010000000100000006.gz, strDestinationPathType = backup:archive, strGroup = [undef], strMode = <0640>, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000006, strSourcePathType = db:absolute, strUser = [undef]
+DEBUG: File->move(): bDestinationPathCreate = true, strDestinationFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000006-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz, strDestinationPathType = absolute, strSourceFile = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000006.gz.tmp, strSourcePathType = absolute
+DEBUG: Main::safeExit(): iExitCode = 0
+ INFO: archive-push stop
> [BACKREST_BIN] --config=[TEST_PATH]/db/pg_backrest.conf --no-fork --stanza=db archive-push [TEST_PATH]/db/common/pg_xlog/000000010000000100000007
------------------------------------------------------------------------------------------------------------------------------------
- INFO: pushing WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000007
-DEBUG: Archive->pushCheck: backup:archive:000000010000000100000007
-DEBUG: File->exists: backup:archive:[TEST_PATH]/backrest/archive/db
-DEBUG: ArchiveInfo->new(): archiveClusterPath = [TEST_PATH]/backrest/archive/db
-DEBUG: File->list: backup:absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, expression ^000000010000000100000007(-[0-f]+){0,1}(\.gz){0,1}$, sort forward
-DEBUG: File->copy: local db:absolute:[TEST_PATH]/db/common/pg_xlog/000000010000000100000007 to local backup:archive:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000007.gz, source_compressed = false, destination_compress = true, ignore_missing_source = false, destination_path_create = true, modification_time = [undef], mode = 0640, user = [undef], group = [undef]
-DEBUG: File->move: absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000007.gz.tmp to absolute:[TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001/000000010000000100000007-1c7e00fd09b9dd11fc2966590b3e3274645dd031.gz, destination_path_create = true
-DEBUG: safe exit called, terminating threads
+ INFO: archive-push start: --db-path=[TEST_PATH]/db/common --log-level-console=debug --log-level-file=trace --no-fork --repo-path=[TEST_PATH]/backrest --repo-remote-path=[TEST_PATH]/backrest --stanza=db
+ INFO: push WAL segment [TEST_PATH]/db/common/pg_xlog/000000010000000100000007
+DEBUG: Archive->pushProcess(): bAsync = false, strSourceFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000007
+DEBUG: File->new(): iThreadIdx = [undef], oProtocol = [object], strBackupPath = [TEST_PATH]/backrest, strDefaultFileMode = <0640>, strDefaultPathMode = <0750>, strRemote = none, strStanza = db
+DEBUG: Archive->walInfo(): strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000007
+DEBUG: Archive->walInfo=>: strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: Archive->pushCheck(): oFile = [object], strDbVersion = 9.3, strWalFile = [TEST_PATH]/db/common/pg_xlog/000000010000000100000007, strWalSegment = 000000010000000100000007, ullDbSysId = 5947969990501855219
+DEBUG: File->exists(): strPath = [undef], strPathType = backup:archive
+DEBUG: File->exists=>: bExists = true
+DEBUG: ArchiveInfo->new(): bRequired = , strArchiveClusterPath = [TEST_PATH]/backrest/archive/db
+DEBUG: ArchiveInfo->check(): strDbVersion = 9.3, ullDbSysId = 5947969990501855219
+DEBUG: ArchiveInfo->archiveId=>: strArchiveId = 9.3-1
+DEBUG: ArchiveInfo->check=>: strArchiveId = 9.3-1
+DEBUG: Archive->walFileName(): iWaitSeconds = [undef], oFile = [object], strArchiveId = 9.3-1, strWalSegment = 000000010000000100000007
+DEBUG: File->list(): bIgnoreMissing = true, strExpression = ^000000010000000100000007(-[0-f]+){0,1}(\.gz){0,1}$, strPath = [TEST_PATH]/backrest/archive/db/9.3-1/0000000100000001, strPathType = backup:absolute, strSortOrder =
+DEBUG: File->list=>: stryFileList = ()
+DEBUG: Archive->walFileName=>: strWalFileName = [undef]
+DEBUG: Archive->pushCheck=>: strArchiveId = 9.3-1, strChecksum = [undef]
+DEBUG: File->copy(): bAppendChecksum = true, bDestinationCompress = true, bDestinationPathCreate = true, bIgnoreMissingSource =