User Tools

Site Tools


backuppc-notes

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
backuppc-notes [2015/04/17 17:43] snargbackuppc-notes [2018/11/26 08:59] snarg
Line 1: Line 1:
-=== Notes on transfering backuppc pc directories *with* hardlinks ===+==== Notes on transfering backuppc pc directories *with* hardlinks ====
  
-== Untarring with hardlinks ==+=== Untarring with hardlinks ===
 The command for extracting a tar made with BackupPC_tarPCCopy: The command for extracting a tar made with BackupPC_tarPCCopy:
 <code>cd newbackupfs/pc <code>cd newbackupfs/pc
Line 7: Line 7:
 (the P is important) (the P is important)
  
-== Piping the restore through netcat ==+=== Piping the transfe through netcat ===
 on source server: on source server:
 <code>BackupPC_tarPCCopy  /var/lib/backuppc/pc/hostname | nc mystic 9800</code> <code>BackupPC_tarPCCopy  /var/lib/backuppc/pc/hostname | nc mystic 9800</code>
Line 15: Line 15:
 <code>cd /var/lib/backuppc/pc <code>cd /var/lib/backuppc/pc
 nc -l -p 9800 | tar -xPpvf -</code> nc -l -p 9800 | tar -xPpvf -</code>
 +
 +If getting a heap of "Cant find xx/x/x in pool, will copy file" errors - It could be because at some point backuppc was configured to not use the compressed pool. Try this patch which checks both pools for the file when generating a hardlink for the pipe to tar.
 +<code>
 +--- /usr/bin/BackupPC_tarPCCopy 2018-10-01 08:52:07.000000000 +0800
 ++++ /usr/local/bin/BackupPC_tarPCCopy-check-both-pools  2018-10-07 15:01:11.000000000 +0800
 +@@ -496,6 +496,32 @@
 +                     }
 +                     $i++;
 +                 }
 ++
 ++               if ( ! defined($linkName) ) {
 ++                       # now second take for the non compressed pool (next line sets compressed flag to 0) 
 ++                       # - no idea why compressed files are making it into there - rob 201810
 ++
 ++                       my $path = $bpc->MD52Path($digest, 0);
 ++                       my $i = -1;
 ++
 ++                       #print(STDERR "didnt find it, trying forcing compression off Looking up $hdr->{fullPath} at $path\n");
 ++                       while ( 1 ) {
 ++                           my $testPath = $path;
 ++                           $testPath .= "_$i" if ( $i >= 0 );
 ++                           last if ( !-f $testPath );
 ++                           my $inode = (stat(_))[1];
 ++                           if ( $inode == $hdr->{inode} ) {
 ++                               #
 ++                               # Found it!  Just emit a tar hardlink
 ++                               #
 ++                               $testPath =~ s{\Q$TopDir\E}{..};
 ++                               $linkName = $testPath;
 ++                               last;
 ++                           }
 ++                           $i++;
 ++                       }
 ++               }
 ++
 +             }
 +         }
 +         if ( defined($linkName) ) {
 +</code>
 +
 +==== Easy backuppc restore via netcat ====
 +In this example the backup hostname is propertywestlocal, and some sample restore directories are given:
 +(as backuppc on server)
 +<code>BackupPC_tarCreate -h propertywestlocal -n 1464 -s /mnt/space/blockwall-client-mirrors/propertywest.com.au -r /mnt/space/blockwall-client-mirrors/propertywest.com.au -p samba /home/samba | nc localhost 38999</code>
 +
 +(as root on target pc [backuppc server if you like])
 +<code>nc -l -p 38999 | tar -xvp</code>
  
backuppc-notes.txt · Last modified: 2018/11/26 09:00 by snarg