Bootstrap FreeKB - Perl (Scripting) - Transfer a file
Perl (Scripting) - Transfer a file

Updated:   |  Perl (Scripting) articles

This script will transfer myFile.txt from server1 to server2.

use Core;
use Utility;
use Options;

# Initialize the logger
$logger = init_logger();

my $user = "root";

print "Enter target server name: ";
my $target_server = <STDIN>;
chomp $target_server;

print "What file do you want to transfer: ";
my $local_file = <STDIN>;
chomp $local_file;

print "Where should the file be stored on the target server: ";
my $remote_file = <STDIN>;
chomp $remote_file;

sub transferFile
    ($stdout, $stderr, $exit) = create_shell($host, $user, $pass);
    $logger->info("Getting ready to transfer your file");


Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee


Add a Comment

Please enter 78122e in the box below so that we can be sure you are a human.