Program: How to FTP logs from a Server to Desktop

Hi guys,

Good day! Anyone there could suggest on how can I create a program that will get (ftp) the logs I need from a remote Server (running in Linux) into my Desktop (running in Windows 7). For Perl program suggestions, FYI that I'm using Active Perl version. The reason why I need this one is that I want to run the program that has been created not on the remote server but in the Desktop itself so not to affect the remote Server.

I've tried these simple codes below:

#!usr/bin/perl

$connect = "ftp <IP>";
system ($connect);

$user = <STDIN>;
chomp $user;
$pass = <STDIN>;
chomp $pass;

if ($user eq /<correct user>/ && $pass eq /<correct pass>/)
{
    $logs_dir = "cd <dir>/";
    system ($logs_dir);
}

it only works for the FTP part and just like an ordinary FTP command it did not save the input user and pass into the variables and nothing else happens.

Please help!

Br,
rymnd_12345

any thoughts about using smbclient?

Hmm. I'm not sure why you're bothering to check the passwords, since FTP ought to reject a bad password by itself. Keeping a hardcoded password in your script really isn't something you want to be doing.

system() of course waits for the entire command to finish. If you want to input things to a command, you do that with open(), though I'm not sure that'll work right in windows:

open(FTP, "|ftp ${ip}") || die("Couldn't open ftp");

print FTP "stuff I want to feed into FTP\n";

close(FTP);