Getting a list of files on an ftp, via shell script...


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Getting a list of files on an ftp, via shell script...
# 1  
Old 01-06-2009
Getting a list of files on an ftp, via shell script...

G'day,

I was wanting to write a shell script that checks an ftp server for the presence of new files, then get those files. In so much as the get, this is pretty straight forward, but I cannot work out how to get a list of files to check. Is it possible for a shell script to get the output of a dir (or similar) command in an ftp session?
# 2  
Old 01-13-2009
This is answered many of times... why don't you search the forum for "ftp script". You might need 2 different ftp sessions -- one to get the list of files, do some shell processing, and then the second to get the files you need. Or you might need to use perl's Net::FTP package.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

shell script to ftp multiple files

Hi, i use the below script to send a single file to remote server from linux. ftp -nvi <<!EOF open $Host_name user $USER_ID $PWD binary mput $file_name quit !EOF (where i... (2 Replies)
Discussion started by: pradebban
2 Replies

2. Emergency UNIX and Linux Support

Shell script to get all the files from FTP server

Hi Guru's, I am new to UNIX. my requirement is to log on to FTP server and get all the .txt files. i have developed one script by searching some forums but getting error and not able to fix them. pls see below code. ftp -i-n<<EOF open $FTP_HOST... (30 Replies)
Discussion started by: arund_01
30 Replies

3. UNIX for Dummies Questions & Answers

ftp files from one server to another using shell script

Hi Guys Any Help I have created a spool file that i need to copy onto another server using FTP in a shell script both servers are linux (3 Replies)
Discussion started by: itai
3 Replies

4. Shell Programming and Scripting

ftp script : list 4 lasts files

Hi, At work we have backups on a ftp. I want to view 4 last files saved (their names, dates, and weight). how can i achieve this goal using simplest way ? Thank's. (3 Replies)
Discussion started by: simon974
3 Replies

5. Shell Programming and Scripting

FTP script to login and list files to log file

Hi Guys I did a forum search for "ftp scripts" Looked at 8 pages and didnt see anything that would help. Most seem to be logging into a ftp server and transfering files. What I need to do is login to a FTP server. Goto a folder and list it so it showes newest files first. It would be nice to... (4 Replies)
Discussion started by: voorhees1979
4 Replies

6. Shell Programming and Scripting

how to connect to a list of IP by ftp in shell script

Hi everyone, I have to maintenance an old script unix (#!bin/sh) that get files from remote host by ftp. There is a configuration file that contains a list of IP; the script reads this file, one line by line, and per each IP execute these commands: echo "verbose on" > ftprap.cmd echo "prompt... (3 Replies)
Discussion started by: molfrome
3 Replies

7. Shell Programming and Scripting

Pulling a list of files from FTP site in a shell script

Hi, I am writting a shell script which will pull a list files (mentioned in one file 1.txt) from external FTP site (for ex: ftp://abcd.efghijk.com/). The 1.txt is in my local unix directory. I have username and password to connect the external FTP site. Also before I pull the files, I need... (0 Replies)
Discussion started by: spatra
0 Replies

8. Shell Programming and Scripting

Reading list of files into ftp script

How can I go about getting this done? I have tried and failed with a loop before I start the session and after seeing that I am already in the ftp code block and not bash when I am trying to perform this: #FTP Information ftp_server=xx.xxx.xxx.xx ftp_user=xxxx while read line; do... (1 Reply)
Discussion started by: BkontheShell718
1 Replies

9. Shell Programming and Scripting

Random files do not FTP in the shell script

The following script is used to loop through files in the /tmp directory and transfer those files onto another server. However, some of the files do not transfer. It is very random when the transferring is done (i.e. one of the files won't transfer then next time, that one will transfer and... (1 Reply)
Discussion started by: RLatham20
1 Replies

10. Shell Programming and Scripting

ftp files inside a shell script

I have a shell script where I am trying to ftp some files but I get the error message "EOF unclosed" every time the script reaches the ftp section. Here is how my script is written. #more code up here rm -f $object >> $LOG_FILE 2>&1 fi #end of if done #end of for loop ... (5 Replies)
Discussion started by: matrix1067
5 Replies
Login or Register to Ask a Question