#!/usr/bin/perl

my $hostname = `hostname`;
chomp $hostname;

my %pairs;
open INPUT, "/common/tmp/epaulson/matching-pairs" or die "can't open input";
while(<INPUT>) {
	chomp;
	($first, $second) = split;
	$pairs{$first} = $second;
}

my $target = $pairs{$hostname};

print "$hostname target is $target\n";


my $curTime = `date`;
print "Start time is $curTime";

my $cmd = "scp /scratch/db2-data-backup.tar " . $target . ":/scratch/db2-data-backup-" . $hostname;
print "$cmd\n";
my $sshresults = `$cmd`;
print $sshresults;


my $endTime = `date`;
print "End time is $endTime";
