1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2024-12-14 10:13:05 +02:00

Added INFO level logging when paths/files/links are removed during the clean phase of restore deltas.

This commit is contained in:
David Steele 2015-01-02 14:15:15 -05:00
parent 32b37335a1
commit 297b22cb2b

View File

@ -239,6 +239,9 @@ sub clean
my $self = shift; # Class hash
my $oManifestRef = shift; # Backup manifest
# Track if files/links/paths where removed
my %oRemoveHash = ('file' => 0, 'path' => 0, 'link' => 0);
# Check each restore directory in the manifest and make sure that it exists and is empty.
# The --force option can be used to override the empty requirement.
foreach my $strPathKey (sort(keys ${$oManifestRef}{'backup:path'}))
@ -333,9 +336,20 @@ sub clean
&log(DEBUG, "removing file/link ${strFile}");
unlink($strFile) or confess &log(ERROR, "unable to delete file/link ${strFile}");
}
$oRemoveHash{$strType} += 1;
}
}
}
# Loop through types (path, link, file) and emit info if any were removed
foreach my $strFileType (sort (keys %oRemoveHash))
{
if ($oRemoveHash{$strFileType} > 0)
{
&log(INFO, "$oRemoveHash{$strFileType} ${strFileType}(s) removed during cleanup");
}
}
}
####################################################################################################################################