/[sysadmin-cookbook]/recepies/netpipe-tcp/test-all.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /recepies/netpipe-tcp/test-all.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 169 - (show annotations)
Sat Feb 20 17:35:42 2010 UTC (9 years, 3 months ago) by dpavlin
File MIME type: text/plain
File size: 740 byte(s)
test just missing files

1 #!/usr/bin/perl
2
3 # usage: test-all.pl hosts
4
5 use warnings;
6 use strict;
7 use autodie;
8 use File::Slurp;
9 use Data::Dump qw(dump);
10
11 chdir '/srv/sysadmin-cookbook/recepies/netpipe-tcp/';
12
13 my @hosts = read_file 'hosts';
14 @hosts = map { chomp; $_ } @hosts;
15 warn "hosts = ",dump(@hosts);
16
17 foreach my $host ( @hosts ) {
18 chomp($host);
19
20 my @test;
21
22 foreach my $to ( @hosts ) {
23 next if -s "$host/$to.np";
24 warn "start NPtcp on $to\n";
25 system "ssh $to NPtcp &";
26 push @test, $to;
27 }
28
29 warn "# missing ", dump(@test);
30
31 open(my $ssh, '|-', "ssh $host xargs -i NPtcp -h {} -u 1048576 -o /tmp/{}.np");
32 foreach my $to ( @test ) {
33 warn "TEST from $host to $to\n";
34 print $ssh "$to\n";
35 }
36 close($ssh);
37
38 system "rsync -v $host:/tmp/*.np $host/";
39 }

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26