X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=bin%2FBackupPC_link;h=7d667849b8ea86cf607625e0b68eac3c69d94051;hp=2528c17daa76f1322ca5af9af3185d60a91fe82d;hb=d1bfa4d92bec24954f2e7877f6531644bb84e8f3;hpb=fadae1eaa5482a441bc8e8aa829a063ee6a5f0c0 diff --git a/bin/BackupPC_link b/bin/BackupPC_link index 2528c17..7d66784 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-2003 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.0beta0, released 3 Sep 2007. +# Version 3.2.0, released 31 Jul 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}")