pgbackrest.git / summary / log / commit / refs
commit 297b22cb2bde9dddf99f557a40f8a6fb6e0807c8
Author: David Steele <david@pgmasters.net>
Date: Fri Jan 02 19:15:15 2015 +0000
Added INFO level logging when paths/files/links are removed during the clean phase of restore deltas.
lib/BackRest/Restore.pm | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/lib/BackRest/Restore.pm b/lib/BackRest/Restore.pm
index ad0187982..21256edef 100644
--- a/lib/BackRest/Restore.pm
+++ b/lib/BackRest/Restore.pm
@@ -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");
+ }
+ }
}
####################################################################################################################################
[parent: 32b37335a14d]