X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=bin%2FBackupPC_nightly;h=29b15e438c7f7f5ed1def3fb163db630bd644466;hp=ff26182dc718f06d93fb8ce9be483e9923e41e9b;hb=5b79f9a3c01bca16dd4d211e76fc53daa549e421;hpb=caa62f13e4ab659d296afbce7bcd01c3c77cf7bb diff --git a/bin/BackupPC_nightly b/bin/BackupPC_nightly index ff26182..29b15e4 100755 --- a/bin/BackupPC_nightly +++ b/bin/BackupPC_nightly @@ -37,7 +37,7 @@ # Craig Barratt # # COPYRIGHT -# Copyright (C) 2001-2004 Craig Barratt +# Copyright (C) 2001-2007 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 @@ -55,7 +55,7 @@ # #======================================================================== # -# Version 3.0.0beta3, released 3 Dec 2006. +# Version 3.1.0, released 25 Nov 2007. # # See http://backuppc.sourceforge.net. # @@ -64,11 +64,10 @@ use strict; no utf8; use lib "/usr/local/BackupPC/lib"; -use BackupPC::Lib; +use BackupPC::Lib qw( :BPC_DT_ALL ); use BackupPC::FileZIO; use Getopt::Std; -use File::Find; use File::Path; use Data::Dumper; @@ -153,7 +152,7 @@ for my $pool ( qw(pool cpool) ) { $fileLinkMax = 0; $fileCntRename = 0; %FixList = (); - find({wanted => \&GetPoolStats}, "$TopDir/$pool/$dir") + $bpc->find({wanted => \&GetPoolStats}, "$TopDir/$pool/$dir") if ( -d "$TopDir/$pool/$dir" ); my $kb = $blkCnt / 2; my $kbRm = $blkCntRm / 2; @@ -260,7 +259,8 @@ sub doBackupInfoUpdate sub GetPoolStats { - my($inode, $nlinks, $nblocks) = (lstat($_))[1, 3, 12]; + my($file, $fullPath) = @_; + my($inode, $nlinks, $nblocks) = (lstat($file))[1, 3, 12]; if ( -d _ ) { $dirCnt++; @@ -279,7 +279,6 @@ sub GetPoolStats # pool files vs removing pool files. (Other aspects of the # design should eliminate race conditions.) # - my $fullPath = $File::Find::name; push(@PendingDelete, { inode => $inode, path => $fullPath @@ -298,7 +297,7 @@ sub GetPoolStats $fullPath =~ s/_\d+$//; $FixList{$fullPath}++; } else { - if ( /_(\d+)$/ ) { + if ( $file =~ /_(\d+)$/ ) { $fileRepMax = $1 + 1 if ( $fileRepMax <= $1 ); $fileCntRep++; }