pgbackrest.git / summary / log / commit / refs

commit    c89984cd59dc2ca1792d8cd99df1978719aed16e
Author:   David Steele <github@thelabyrinth.net>
Date:     Thu Jan 09 23:02:42 2014 +0000

    Revert 2914a6d..e31b21f
    
    This rolls back to commit 2914a6dcc67b120be0ee5d808590849ebe9c3664.


pg_backrest.pl | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/pg_backrest.pl b/pg_backrest.pl index 7a8b98245..39485f646 100755 --- a/pg_backrest.pl +++ b/pg_backrest.pl @@ -302,6 +302,7 @@ sub backup_manifest_build my $strCommandManifest = shift; my $strClusterDataPath = shift; my $oBackupManifestRef = shift; + my $oLastManifestRef = shift; my $oTablespaceMapRef = shift; my $strLevel = shift; @@ -353,6 +354,15 @@ sub backup_manifest_build if ($cType eq "f") { ${$oBackupManifestRef}{"${strSection}"}{"$strName"}{size} = $oManifestHash{name}{"${strName}"}{size}; + +# if (defined(${$oLastManifestRef}{"${strSection}"}{"$strName"})) +# { +# if (${$oBackupManifestRef}{"${strSection}"}{"$strName"}{size} == ${$oLastManifestRef}{"${strSection}"}{"$strName"}{size} && +# ${$oBackupManifestRef}{"${strSection}"}{"$strName"}{modification_time} == ${$oLastManifestRef}{"${strSection}"}{"$strName"}{modification_time}) +# { +# ${$oBackupManifestRef}{"${strSection}"}{"$strName"}{reference} = ${$oLastManifestRef}{common}{backup}{label}; +# } +# } } if ($cType eq "l") @@ -368,7 +378,7 @@ sub backup_manifest_build ${$oBackupManifestRef}{"${strLevel}:tablespace"}{"${strTablespaceName}"}{oid} = $strTablespaceOid; ${$oBackupManifestRef}{"${strLevel}:tablespace"}{"${strTablespaceName}"}{path} = $strLinkDestination; - backup_manifest_build($strCommandManifest, $strLinkDestination, $oBackupManifestRef, $oTablespaceMapRef, "tablespace:${strTablespaceName}"); + backup_manifest_build($strCommandManifest, $strLinkDestination, $oBackupManifestRef, $oLastManifestRef, $oTablespaceMapRef, "tablespace:${strTablespaceName}"); } } } @@ -556,6 +566,14 @@ sub backup #################################################################################################################################### # Get the command my $strOperation = $ARGV[0]; +my $strLogFile = ""; + +# !!! Pick the log file name here (backup, restore, archive-YYYYMMDD) +# +if ($strOperation eq "archive-push") +{ + +} #################################################################################################################################### # LOAD CONFIG FILE @@ -737,9 +755,12 @@ if ($strOperation eq "backup") # Find the previous backup based on the type my $strBackupLastPath = backup_type_find($strType, $strBackupClusterPath); + my %oLastManifest; + if (defined($strBackupLastPath)) { - &log(INFO, 'Last backup: ' . $strBackupLastPath); + %oLastManifest = backup_manifest_load("${strBackupClusterPath}/$strBackupLastPath/backup.manifest"); + &log(INFO, "Last backup label: $oLastManifest{common}{backup}{label}"); } # Create the path for the new backup @@ -791,6 +812,7 @@ if ($strOperation eq "backup") # Start backup my $strLabel = $strBackupPath; + ${oBackupManifest}{common}{backup}{label} = $strLabel; my $strArchiveStart = trim(execute($strCommandPsql . " -c \"copy (select pg_xlogfile_name(xlog) from pg_start_backup('${strLabel}') as xlog) to stdout\" postgres")); @@ -801,7 +823,7 @@ if ($strOperation eq "backup") # Build the backup manifest my %oTablespaceMap = tablespace_map_get($strCommandPsql); - backup_manifest_build($strCommandManifest, $strClusterDataPath, \%oBackupManifest, \%oTablespaceMap); + backup_manifest_build($strCommandManifest, $strClusterDataPath, \%oBackupManifest, \%oLastManifest, %oTablespaceMap); # Perform the backup # backup($strCommandChecksum, $strCommandCompress, $strCommandDecompress, $strCommandCopy, $strClusterDataPath, [parent: e31b21f95aa5]