Program: How to FTP logs from a Server to Desktop


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Program: How to FTP logs from a Server to Desktop
# 1  
Old 12-09-2011
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  
Old 12-09-2011
any thoughts about using smbclient?
# 3  
Old 12-09-2011
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);

 
Login or Register to Ask a Question

Previous Thread | Next Thread

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. Shell Programming and Scripting

Upload files from desktop to unix through FTP

Hi , I want to upload some files from my desktop to unix server through FTP . The list of files are in a text file .Please suggest how to do it through scrip . Thanks in advance .. Anupam (8 Replies)
Discussion started by: anupamhalder
8 Replies

6. 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

7. 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

8. 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

9. 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
Login or Register to Ask a Question