summaryrefslogtreecommitdiffstats
path: root/move/tools
diff options
context:
space:
mode:
Diffstat (limited to 'move/tools')
-rw-r--r--move/tools/busy-files-accesses28
1 files changed, 28 insertions, 0 deletions
diff --git a/move/tools/busy-files-accesses b/move/tools/busy-files-accesses
new file mode 100644
index 000000000..72dbc119b
--- /dev/null
+++ b/move/tools/busy-files-accesses
@@ -0,0 +1,28 @@
+#!/usr/bin/perl
+
+use MDK::Common;
+use Getopt::Long;
+
+GetOptions('no-link' => \ (my $no_link),
+ 'no-dir' => \ (my $no_dir),
+ 'full-dirs=s', \ (my $full_dirs),
+);
+
+if ($full_dirs) {
+ my @l = map { chomp_(MDK::Common::File::cat_or_die($_)) } split(' ', $full_dirs);
+ $full_dirs = '/tmp/live_tree(' . join('|', map { quotemeta } @l) . ')/';
+}
+
+my ($file_list) = @ARGV;
+foreach my $file (cat_($file_list)) {
+ chomp $file;
+
+ $file =~ m!/tmp/live_tree! or next;
+
+ if (-l $file ? !$no_link : -d $file ? !$no_dir : 1) {
+ my $s = $full_dirs && $file =~ /^$full_dirs/ ? "/tmp/live_tree$1" : $file;
+ push @l, $s;
+ }
+}
+
+print "$_\n" foreach uniq(@l);