#!/perl/bin/perl -wT
use CGI qw(:standard);
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
use strict;
$ENV{'PATH'} = 'C:\\Temp\\';
#Declare the variables
my $result;
my $staging_area = param('staging');
my $directory = param('directory');
my $user_id = param('userid');
my $passwd = param('passwd');
my $store = param('store');
#Attach the store directory to the diectory variable
$directory = $directory . "/" . $store;
#Set the directory where pscp.exe resides
my $pscp_dir = 'C:\\Temp\\';
#Construct the pscp command with the right arguments
my $command = $pscp_dir . "pscp.exe -batch -pw " . $passwd . " " . $user_id . "@" . $staging_area . ":" . $directory . "/" . $store . "*.tgz " . $pscp_dir;
#Execute the command
system($command);
if ( $? == -1 )
{
$result = "command failed: $!\n";
}
print header;
print start_html("Thank You");
print h2("Thank You");
print "$command
\n";
print "$result
\n";
print end_html;