Not able to FTP the files to a FTP server


 
Thread Tools Search this Thread
Special Forums Hardware Filesystems, Disks and Memory Not able to FTP the files to a FTP server
# 1  
Old 04-24-2009
Not able to FTP the files to a FTP server

Hi ,

We are facing a weird problem in our project. we need to send some xml & audio files to a remote FTP server from a Linux box, we are doing this in Perl script using Net::FTP->. Issue here is.. when FTPed the files using Perl scripts, only empty files ( 0 byte) are getting created on the remote server and data is not getting written onto the server. But we are able to manually transfer files to FTP server through a FTP tool but they fail when we try to do the same through Perl script. We checked on the remote server and there is a lot of free space on the server.

Our script is returning 'Bad File Descriptor' error where as it is working fine for all the rest of the other 50 FTP servers we have.

Any help /inputs regards this issue would be greatly appreciated.

Thanks
# 2  
Old 04-26-2009
Hello, you have done the fisrt good steps for troubleshooting this issue. It seems that only the perl script cannot interact properly with this FTP server and this OS, the remote one. Please let us know the versions of the OS, FTPD and post some perl code, if possible. Looks like a compatibility issue, since the script is working against other OSes and some other FTP servers. It is important to answer the following questions as well - Have I changed the script, what OSes and FTP servers my script works with, and what's the difference on the remote end, in this particular task. Can you execute the same task against other machine ? Are there any special characters or Windows-like paths in the script ? I have seen "bad file descriptor" with either corrupted test source file, or against Windows FTP - I was missing the correct Windows path represenation. HTH.
# 3  
Old 04-28-2009
Not able to FTP the files to a FTP server

Hi, Thaks for your quick response.

Our Linux box OS ---> Red Hat Enterprise Linux 2.4.21-47.0.1 (release 3 )
Remote FTP server OS ---> Ubuntu 6.06.1

Below is Perl code,which we are using to connect to remote FTP server and to transfer the files.

eval { $ftp = Net::FTP->new($remoteServerIP, Debug => 0) or $exitModule='TRUE' };
if ($@ or $exitModule eq 'TRUE') {

log_error("ERROR: Failed to connect to " ) ;
eval { $ftp->close() }

}else{
eval { $ftp -> login($User,$Pwd) or $exitModule='TRUE' };
if ($@ or $exitModule eq 'TRUE') {
log_error ("ERROR: (" . $ftp->message . ") Failed to login");
eval { $ftp->close()}
}else{
eval { $ftp->put($sourceFile , $targetFile) or $status = 'ERROR' };
my $ftp_message = $ftp->message;
if ($@ or $status eq 'ERROR') {
log_error ("WARNING: (" . $ftp_message . ") Error during transmission");
}
}
};


We are getting the error "WARNING: Failed to transfer file. Error during transmission" (when tried to push the files using above Perl code) since two months before that we were able to transfer the files. We haven't made any changes on our server and remote severt for the last 12 months. We are not able to figure out what suddenly causing the issue.

Thanks.



Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

How Do I FTP System Files to Different Server?

Hello, I have a legacy system that is running on SCO OpenServer 5.0.6, and the hardware is becoming a little sketchy. I replaced the hard drive about a year ago, and was able to come back from a tape backup of my entire system. I have been successful with building a VM with VMware Workstation,... (42 Replies)
Discussion started by: spock9458
42 Replies

2. Solaris

FTP-ing files from Windows server to UNIX server

I need to transfer files from a Windows server to the Unix server and have to run some shell script on it to get the required output. Is it possible to transfer files from Windows server to unix server through any shell script? If so can you please help me with the details. Thanks in... (8 Replies)
Discussion started by: ssk250
8 Replies

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

4. HP-UX

[Solved] Unable to rename file in ftp server .Net:FTP perl

Hello All, I am trying to connect to ftp server and get the files. Also i need to rename the file in other ftp dir. rename method is not allowing me to rename the file in other dir. When i tried copy command by using net::FTP:FILE then perl says it is not installed. Can some body help me to... (2 Replies)
Discussion started by: krsnadasa
2 Replies

5. Shell Programming and Scripting

script for to take files from FTP server to UNIX server and Unzipped that files

script for to take files from FTP server to UNIX server and Unzipped that files (1 Reply)
Discussion started by: sunilamarnadh
1 Replies

6. Shell Programming and Scripting

Need help in deleting old files from a ftp server

Hi, I'm quite new to unix and perl scripting and need to write a script to delete files older than 7 days from a remote ftp server. Unix or Perl script would do... I wrote the following code: #!/usr/local/bin/perl use File::Basename; use Net::FTP; #use Net::FTP::File; my $verbose =... (15 Replies)
Discussion started by: arunsoman80
15 Replies

7. UNIX for Dummies Questions & Answers

FTP Files from one server to another

Hi, I want to run a process on server a, pulling files from server b and pushing it to server c. Can i do that without dropping the files on server a? Thanks, Samit (2 Replies)
Discussion started by: samit_9999
2 Replies

8. Shell Programming and Scripting

ftp script not able to connect to ftp server.

I have the following ftp script to get files from a remote location. However, on running the script I find that I am not even able to connect to ftp server. I am able to connect to ftp server using other GUI ftp tools like WS_FTP using the same IP. IP used here is a dummy IP. What can go... (3 Replies)
Discussion started by: gram77
3 Replies

9. UNIX for Dummies Questions & Answers

Listing all files on FTP Server

Hello, I am the definition of UNIX newbie so please bare with me. I am wondering the best way to list all files on a ftp server. If I use curl -l ftp://user:password@ftp_server This shows me the root of the ftp server, but I would like to get a listing of everything in the subfolders ... (7 Replies)
Discussion started by: Dallasbr
7 Replies

10. Shell Programming and Scripting

FTP multiple files from remote server to local server

Hi, I am facing a weired problem in my FTP script. I want to transfer multiple files from remote server to local server everyday, using mget * in my script. I also, want to send an email for successful or failed FTP. My script works for file transfer, but it don't send any mail. There is... (2 Replies)
Discussion started by: berlin_germany
2 Replies
Login or Register to Ask a Question