summaryrefslogtreecommitdiffstats
path: root/move/tools/nfs-accesses
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-04-08 14:58:52 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-04-08 14:58:52 +0000
commit1aea26dacfe4fce20ee205ba817c2faf7fd7d103 (patch)
treefce444e1dd0dc5c0da4c56e8206e84cc1a6d727f /move/tools/nfs-accesses
parentb71ee7da24b8d648c7f542698e284e731bf1ca2e (diff)
downloaddrakx-1aea26dacfe4fce20ee205ba817c2faf7fd7d103.tar
drakx-1aea26dacfe4fce20ee205ba817c2faf7fd7d103.tar.gz
drakx-1aea26dacfe4fce20ee205ba817c2faf7fd7d103.tar.bz2
drakx-1aea26dacfe4fce20ee205ba817c2faf7fd7d103.tar.xz
drakx-1aea26dacfe4fce20ee205ba817c2faf7fd7d103.zip
handle option "--already-have=..." alike busy-files-accesses
Diffstat (limited to 'move/tools/nfs-accesses')
-rwxr-xr-xmove/tools/nfs-accesses7
1 files changed, 7 insertions, 0 deletions
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;