Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/perl
- die "Need to provide a filename, e.g., $0 dev.tar" if @ARGV < 1;
- my ($file, @machines) = @ARGV;
- my %machines = (
- rackspace => [ qw/vpn iad dfw webfs slice1/ ],
- VPNServer => [ qw/m2 m3 webfs messaging-api1 inf-api1/ ],
- );
- unless (@machines) {
- chomp (my $hostname = `hostname`);
- @machines = @{$machines{$hostname}} if $machines{$hostname};
- }
- foreach my $m (@machines) {
- print "$m ...\n";
- die "Could not scp to $m\n" if system "scp $file $m:";
- die "Could not untar in $m\n" if system "ssh $m tar xf $file";
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement