X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=bin%2FBackupPC_link;h=c1a5604ed488a8dc3ae675670f6cb2702dfb2c9c;hp=5a58ae4ee0a959527ee0da99b8bff2da65c158b5;hb=ca593f66fd6c35764bd8997c6338b781330f019c;hpb=fda25dc88a63ccac1c80efa2e4994bf0725ca9b7 diff --git a/bin/BackupPC_link b/bin/BackupPC_link index 5a58ae4..c1a5604 100755 --- a/bin/BackupPC_link +++ b/bin/BackupPC_link @@ -1,4 +1,4 @@ -#!/bin/perl +#!/usr/bin/perl #============================================================= -*-perl-*- # # BackupPC_link: link new backup into pool @@ -21,7 +21,7 @@ # Craig Barratt # # COPYRIGHT -# Copyright (C) 2001-2007 Craig Barratt +# Copyright (C) 2001-2009 Craig Barratt # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -39,7 +39,7 @@ # #======================================================================== # -# Version 3.1.0, released 25 Nov 2007. +# Version 3.2.0beta1, released 10 Jan 2010. # # See http://backuppc.sourceforge.net. # @@ -108,12 +108,23 @@ while ( 1 ) { $CurrDumpDir = "$Dir/$Backups[$num]{num}"; $Compress = $Backups[$num]{compress}; if ( open(NEW, "<", "$Dir/NewFileList.$Backups[$num]{num}") ) { + my(@shareAttribArgs); binmode(NEW); while ( ) { chomp; next if ( !/(\w+) (\d+) (.*)/ ); - LinkNewFile($1, $2, "$CurrDumpDir/$3"); + if ( $3 eq "attrib" ) { + # + # Defer linking top-level attrib file until the end + # since it can appear multiple times when multiple shares + # are dumped. + # + @shareAttribArgs = ($1, $2, "$CurrDumpDir/$3"); + } else { + LinkNewFile($1, $2, "$CurrDumpDir/$3"); + } } + LinkNewFile(@shareAttribArgs) if ( @shareAttribArgs ); close(NEW); } unlink("$Dir/NewFileList.$Backups[$num]{num}")