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

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");


Add a Comment

We will never share your name or email with anyone. Enter your email if you would like to be notified when we respond to your comment.

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


Web design by yours truely - me, myself, and I   |   |