FTP problem to find file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting FTP problem to find file
# 1  
Old 05-28-2009
FTP problem to find file

Hi everybody,

i suddenly got in a requirement whereby:

I have to create a script whereby I need to connect with a remote server with a FTP script [regular ftp and not sftp/ssh] and search whether a file named filename.txt or *.txt exists or not in the remote server. If it exists then my script has to return a value.

Is it at all possible?

Thanks in advance.
# 2  
Old 05-28-2009
you can use autoexpect

AUTOEXPECT(1) manual page
# 3  
Old 05-28-2009
Hi dont hv autoexpect research3 in unix
# 4  
Old 05-28-2009
You don't have permission to install it?
# 5  
Old 05-28-2009
no i dont. thanks research3
# 6  
Old 05-28-2009
Quote:
Originally Posted by RubinPat
Hi everybody,

i suddenly got in a requirement whereby:

I have to create a script whereby I need to connect with a remote server with a FTP script [regular ftp and not sftp/ssh] and search whether a file named filename.txt or *.txt exists or not in the remote server. If it exists then my script has to return a value.

Is it at all possible?

Thanks in advance.
what are you stuck with. show your code. you have a previous thread on FTP also.
one way you can check if to do a listing and get the results piped to a search tool such as grep/awk. Pls put in some effort.
# 7  
Old 05-28-2009
yes ghostdog..I couldn't figure it , Honestly I am stuck with whether I can use

if [ -e exists]; then
echo "i am there"

inside a ftp script for example [my below script pattern might be wrong]

HOST
USER
PASSWORD

ftp -in <>

bi

END SCRIPT
EXIT

I just need to know how can i use the if then else or or other commands inside the ftp statement..Thanks so much
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

[Need HELP] Find aging file and auto FTP

Dear Experts, I have script to find aging file like this: find /ArchiveINTF/INTF name "*" -type f -mtime +365 {} \; >> agingfile.txt This script will find all files over 365 days. But, I have problem, how to auto FTP all files? Thanks Edy (3 Replies)
Discussion started by: edydsuranta
3 Replies

2. Shell Programming and Scripting

Problem with embedded FTP command in Ksh - System Cannot find the specified path.

I have the following FTP embedded in a Ksh script on AIX 5.3 ftp -n <<WHATEVER open 10.101.26.218 user hcistats ******* ascii put $thupdatefile put $thcollectfile quit WHATEVER Here is what my script returns: ... (3 Replies)
Discussion started by: troym72
3 Replies

3. UNIX for Advanced & Expert Users

Using FTP to check whether file is completely FTP... plz find the description below

Hi, We have some clients who will place huge files in to one of the remote server. And the shell script written in our local server to retrieve client files (using FTP) placed on one of the remote server of ours by clients. My question Is there any FTP command/script to check from my local... (1 Reply)
Discussion started by: nmsrao
1 Replies

4. UNIX for Advanced & Expert Users

Problem in FTP of file with chinese chars

Hi, I have a file in my PC with Chinese (PRC) characters. When I transfer that file into my AIX5.3 server through FTP, I get junk characters instead of Chinese chars. Last week I copied the content from my notepad and pasted in vi editor. The Chinese characters were correct, but when I try now,... (4 Replies)
Discussion started by: carthyc
4 Replies

5. UNIX for Dummies Questions & Answers

UNIX FTP file problem

Hi, I am new to this forum. I have a problem and I ws hoping you guys can help me out here. the problem: I have a batch job running on a Unix Server, and it transfers files from the unix server to another server. the series of commands are as follows: > LS Listing the files > Logging into... (4 Replies)
Discussion started by: Vanilmirth
4 Replies

6. UNIX for Advanced & Expert Users

Large file FTP problem

We are experiencing a problem on a lengthy data transfer by FTP through a firewall. Since there are two ports in use on a ftp transfer (data and control), one sits idle while the other's transfering data. The idle port (control) will get timed out and the data transfer won't know that it's... (3 Replies)
Discussion started by: rprajendran
3 Replies

7. UNIX for Dummies Questions & Answers

problem while making ftp of a large file

Hi Friends, I'mfacing a problem while doing ftp of a large file.The control session is getting closed after sometime.But data session transfers the file successfully even when the control seeion is lost.I need to make the control session available as long as data session is active. How can i... (1 Reply)
Discussion started by: rprajendran
1 Replies

8. Shell Programming and Scripting

File Name Problem from FTP

Hi, there. I am new to UNIX and I am writing a script that it uses the FTP to get a list of the files from the FTP server, and compares this list with the local folder to check if the file already exists. If not exist, then it connects to the FTP server again to download the files The problem is... (1 Reply)
Discussion started by: czbtony
1 Replies

9. Ubuntu

Debian (ubuntu) file problem after ftp

Hi, I am using Debian (ubuntu). whenever I ftp file from Windows to Debian, the file is being shown as DOS while editing in vi. The control characters are not visible and I couldn't remove the '^M' character. So please help me how to make it Linux specific file to use it for Linux specific tasks. (4 Replies)
Discussion started by: royalibrahim
4 Replies

10. Shell Programming and Scripting

ftp UnixWare File Size Problem

Hi Engg. ! :cool: When I am trafering a file through ftp from windows to UNIX having size about 1.24 GB then at the end of file transfer I got a error message "Extended file size limit (coredump)" and finnally ftp stop, whenever on other UNIX server the same file from windows... (1 Reply)
Discussion started by: Niraj Gopal Sha
1 Replies
Login or Register to Ask a Question