From 1aea26dacfe4fce20ee205ba817c2faf7fd7d103 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Thu, 8 Apr 2004 14:58:52 +0000 Subject: handle option "--already-have=..." alike busy-files-accesses --- move/tools/nfs-accesses | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'move') diff --git a/move/tools/nfs-accesses b/move/tools/nfs-accesses index fed4aa181..f27de0d37 100755 --- a/move/tools/nfs-accesses +++ b/move/tools/nfs-accesses @@ -13,6 +13,7 @@ GetOptions('no-link' => \ (my $no_link), 'log-file=s' => \$log_file, 'first-file=s' => \ (my $first_file), 'from-time=s', => \ (my $from_time), + 'already-have=s', \ (my $already_have), ); my @skipped_dirs = ( @@ -30,6 +31,10 @@ if ($full_dirs) { my @l = chomp_(map { MDK::Common::File::cat_or_die($_) } split(' ', $full_dirs)); $full_dirs = '/tmp/live_tree(' . join('|', map { quotemeta } @l) . ')/'; } +if ($already_have) { + my @l = map { chomp_(MDK::Common::File::cat_or_die($_)) } split(' ', $already_have); + $already_have = '(' . join('|', map { quotemeta } @l) . ')'; +} open(my $F, "tac $log_file |"); @@ -48,6 +53,8 @@ while (<$F>) { last if $file =~ m!/tmp/live_tree/move/(devices|symlinks)!; last if $from_time && $time le $from_time; + $already_have && $file =~ /^$already_have$/ and next; + if ($file !~ /^$skipped_dirs/) { if (-l $file ? !$no_link : -d $file ? !$no_dir : 1) { my $s = $full_dirs && $file =~ /^$full_dirs/ ? "/tmp/live_tree$1" : $file; -- cgit v1.2.1