/usr/share/perl5/pgBackRest/Protocol/LocalMinion.pm is in pgbackrest 1.12-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | ####################################################################################################################################
# PROTOCOL LOCAL MINION MODULE
####################################################################################################################################
package pgBackRest::Protocol::LocalMinion;
use parent 'pgBackRest::Protocol::CommonMinion';
use strict;
use warnings FATAL => qw(all);
use Carp qw(confess);
use pgBackRest::BackupFile;
use pgBackRest::Common::Log;
use pgBackRest::Config::Config;
use pgBackRest::File;
use pgBackRest::Protocol::Common;
use pgBackRest::Protocol::CommonMinion;
use pgBackRest::Protocol::Protocol;
use pgBackRest::RestoreFile;
####################################################################################################################################
# CONSTRUCTOR
####################################################################################################################################
sub new
{
my $class = shift; # Class name
# Assign function parameters, defaults, and log debug info
my
(
$strOperation,
$strCommand,
) =
logDebugParam
(
__PACKAGE__ . '->new', \@_,
{name => 'strCommand'},
);
# Init object and store variables
my $self = $class->SUPER::new(
CMD_LOCAL, $strCommand, optionGet(OPTION_BUFFER_SIZE), optionGet(OPTION_COMPRESS_LEVEL),
optionGet(OPTION_COMPRESS_LEVEL_NETWORK), optionGet(OPTION_PROTOCOL_TIMEOUT));
bless $self, $class;
# Return from function and log return values if any
return logDebugReturn
(
$strOperation,
{name => 'self', value => $self}
);
}
####################################################################################################################################
# init
####################################################################################################################################
sub init
{
my $self = shift;
# Assign function parameters, defaults, and log debug info
my ($strOperation) = logDebugParam(__PACKAGE__ . '->init');
# Create the file object
my $oFile = new pgBackRest::File
(
optionGet(OPTION_STANZA),
optionGet(OPTION_REPO_PATH),
protocolGet(optionGet(OPTION_TYPE), optionGet(OPTION_HOST_ID), {iProcessIdx => optionGet(OPTION_PROCESS)})
);
# Create anonymous subs for each command
my $hCommandMap =
{
&OP_BACKUP_FILE => sub {backupFile($oFile, @{shift()})},
&OP_RESTORE_FILE => sub {restoreFile($oFile, @{shift()})},
# To be run after each command to keep the remote alive
&OP_POST => sub {$oFile->{oProtocol}->keepAlive()},
};
# Return from function and log return values if any
return logDebugReturn
(
$strOperation,
{name => 'hCommandMap', value => $hCommandMap}
);
}
1;
|