projects
/
BackupPC.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
configure which search module to load using KINO
[BackupPC.git]
/
bin
/
BackupPC_nightly
diff --git
a/bin/BackupPC_nightly
b/bin/BackupPC_nightly
index
c38e68e
..
fbef7dd
100755
(executable)
--- a/
bin/BackupPC_nightly
+++ b/
bin/BackupPC_nightly
@@
-1,4
+1,4
@@
-#!/bin/perl
+#!/
usr/
bin/perl
#============================================================= -*-perl-*-
#
# BackupPC_nightly: Nightly cleanup & statistics script.
#============================================================= -*-perl-*-
#
# BackupPC_nightly: Nightly cleanup & statistics script.
@@
-37,7
+37,7
@@
# Craig Barratt <cbarratt@users.sourceforge.net>
#
# COPYRIGHT
# Craig Barratt <cbarratt@users.sourceforge.net>
#
# COPYRIGHT
-# Copyright (C) 2001-200
4
Craig Barratt
+# Copyright (C) 2001-200
9
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
#
# 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.0alpha, released 23 Jan 2006
.
+# Version 3.
2.0, released 31 Jul 2010
.
#
# See http://backuppc.sourceforge.net.
#
#
# See http://backuppc.sourceforge.net.
#
@@
-64,11
+64,10
@@
use strict;
no utf8;
use lib "/usr/local/BackupPC/lib";
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 BackupPC::FileZIO;
use Getopt::Std;
-use File::Find;
use File::Path;
use Data::Dumper;
use File::Path;
use Data::Dumper;
@@
-153,7
+152,7
@@
for my $pool ( qw(pool cpool) ) {
$fileLinkMax = 0;
$fileCntRename = 0;
%FixList = ();
$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;
if ( -d "$TopDir/$pool/$dir" );
my $kb = $blkCnt / 2;
my $kbRm = $blkCntRm / 2;
@@
-170,6
+169,15
@@
for my $pool ( qw(pool cpool) ) {
$dirCnt++ if ( ($i % 16) == 0
&& -d "$TopDir/$pool/$hexChars[int($i / 16)]" );
$dirCnt++ if ( ($i % 16) == 0
&& -d "$TopDir/$pool/$hexChars[int($i / 16)]" );
+ #
+ # We need to process all pending deletes before we do the
+ # renames
+ #
+ if ( @PendingDelete ) {
+ sleep(1);
+ processPendingDeletes(1);
+ }
+
#
# Now make sure that files with repeated checksums are still
# sequentially numbered
#
# Now make sure that files with repeated checksums are still
# sequentially numbered
@@
-203,7
+211,7
@@
for my $pool ( qw(pool cpool) ) {
}
}
}
}
-sleep(1
0
);
+sleep(1);
processPendingDeletes(1);
###########################################################################
processPendingDeletes(1);
###########################################################################
@@
-251,7
+259,8
@@
sub doBackupInfoUpdate
sub GetPoolStats
{
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++;
if ( -d _ ) {
$dirCnt++;
@@
-270,7
+279,6
@@
sub GetPoolStats
# pool files vs removing pool files. (Other aspects of the
# design should eliminate race conditions.)
#
# 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
push(@PendingDelete, {
inode => $inode,
path => $fullPath
@@
-289,7
+297,7
@@
sub GetPoolStats
$fullPath =~ s/_\d+$//;
$FixList{$fullPath}++;
} else {
$fullPath =~ s/_\d+$//;
$FixList{$fullPath}++;
} else {
- if ( /_(\d+)$/ ) {
+ if (
$file =~
/_(\d+)$/ ) {
$fileRepMax = $1 + 1 if ( $fileRepMax <= $1 );
$fileCntRep++;
}
$fileRepMax = $1 + 1 if ( $fileRepMax <= $1 );
$fileCntRep++;
}