Program: How to FTP logs from a Server to Desktop


 
Thread Tools Search this Thread
# 1  
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:

Code:
#!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

Last edited by methyl; 12-09-2011 at 06:29 AM.. Reason: please use code tags
# 2  
any thoughts about using smbclient?
# 3  
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:

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

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

close(FTP);

 

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Science: Computers
Difficulty: Medium
It's not possible to format a write-protected DVD-R Hard Disk.
True or False?

9 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How to see the status of all the ftp put & get files logs and curent ftp transfer status ?

How to see the status of all the ftp put & get files logs and curent ftp transfer status if any active ftp running in the background ? (2 Replies)
Discussion started by: i4ismail
2 Replies

2. Red Hat

Implement FTP server on RHEL server without using FTP client

We have RHEL 5.8 in our environment, I had a query whether we can implement an FTP server using vsftpd package and Linux configurations like setsebool without using any external FTP clients like FileZilla etc. I am very confused on this. The FTP functionalities that should be present are download &... (3 Replies)
Discussion started by: RHCE
3 Replies

3. UNIX and Linux Applications

Need a FTP SERVER Program FREE

I need a FTP SERVER program for using in ubuntu, Do you know any for free? ps: there will be no internet connection so, vsftp will not work. need a tool (like filezilla but filezilla has no server version for unix ubuntu) that has to be installation package to extract in it. (6 Replies)
Discussion started by: F@NTOM
6 Replies

4. Shell Programming and Scripting

Capturing FTP logs

Hi Guys, I am trying to capture the FTP Logs in a log file. I am using the below code. ftp -d -n -v $Remote_Host << EOD > $Ftp_LOG; Since iam running the script in debug mode, i am able to see that the ftp is done and the file has been transferred. But the log file does not have... (7 Replies)
Discussion started by: mac4rfree
7 Replies

5. UNIX for Advanced & Expert Users

FTP Logs in Unix

Hi. Is there a way or command (other than netstat) in Unix to find out or get a list a users who FTP into a particular server? Like, say last 1000 users. I need to get the user ID (any info), who FTP to a particular server. netstat gives only the users who have an FTp session currently. ... (4 Replies)
Discussion started by: manisendhil
4 Replies

6. Shell Programming and Scripting

Help loading a program into perl from a file on desktop

So I want to use this program that I have downloaded from: PaGE - Patters from Gene Expression However, I am not sure how to actually get in to and run the program... I can log into the server, and was assuming I needed to get the "PaGE_5.1.6.pl" file into a folder some how, but not sure how to... (2 Replies)
Discussion started by: silkiechicken
2 Replies

7. UNIX for Dummies Questions & Answers

FTP Logs in Unix

Hi. Is there a way or command (other than netstat) in Unix to find out or get a list a users who FTP into a particular server? Like, say last 1000 users. I need to get the user ID (any info), who FTP to a particular server. netstat gives only the users who have an FTp session currently. ... (2 Replies)
Discussion started by: manisendhil
2 Replies

8. Shell Programming and Scripting

How to get return value from C program and logs to file

Hi, I have written scritp which prints output from the executable to standard output as well as in a file. Here "add" is an c executable which returns some value based on inputs. But if tee is not used "$?" returns the return value from add exe. If tee is used it is simply retuning 0. echo... (5 Replies)
Discussion started by: yhacks
5 Replies

9. Shell Programming and Scripting

AIX , unix ftp to windows desktop

Hi guys, i want to know if i can make a script to ftp or sftp files from the unix box to my windows desktop or c: drive. I log into the server through Putty, once in the server i run a script which makes a file called disk.log every 30 minutes. i then have to manually copy it to the computer... (2 Replies)
Discussion started by: hassanj
2 Replies

Featured Tech Videos