How check for a new file on a ftp-server


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How check for a new file on a ftp-server
# 1  
Old 10-14-2008
Question How check for a new file on a ftp-server

Hi there,

I want to write a linux shellscript that checks a specific folder on a specific FTP-server whether there are new files or not. If there are new files I want to download them to a local directory (to gain access for an local application to these files). The problem is that the files I suggest to find on that FTP are too big for downloading and comparing them with local files.

Do you have an idea how I can check via a ftp-connection whether there are new files or not? How can I check and compare those files?

BTW:
I use "ftp" with a self-produced .ftp-file which i use as inputfile that gives the commands to the ftp prrogram. The rest of the script is finished but the check-action is missing...

Thanks for your help
# 2  
Old 10-14-2008
Do you know about wget and its ability to maintain a directory listing (--no-remove-listing)?
MrC
# 3  
Old 10-14-2008
use ls -l within ftp. You don't have to download the file from ftp and check for that

and compare the filesize with the local copy - that should give an hint
# 4  
Old 10-15-2008
Question

Ok, the situation changed a bit:

- I have to connect to a ftp-server
- There are files of .csv-type
- I need to download all of these .csv-files
- After each download I have to put a flag-file for the download to the server (e.g. if I download "xyz-2008-10-12.csv" I have to upload a file called "xyz-2008-10-12.csv.ok" with the size of 0 kb)
(- There is a script running on the ftp-server that moves all files which have a .ok-flagfile to an archive folder)

How can I get a list of the filenames on ftp the easiest way, to touch the new 0 kb-ok-files?

Thanks..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Update/Download file from FTP server to UNIX Server

HI Guys, I want to download files from FTP Server to my Unix server. I have tried , buy No Luck . Below Command i have tried. 1-Wget - Error "wget' not found" 2.ftp -n $HOST ...Not Working. 3.scp -i ftp://user:passowrd@hostname:21/ran/on/test.txt Any Suggestion (2 Replies)
Discussion started by: pareshkp
2 Replies

2. Shell Programming and Scripting

Check the space in ftp server

i am connected to the ftp server. how to check the space in that server. what is the command to check in the below command prompt ftp> ftp> (1 Reply)
Discussion started by: ramkumar15
1 Replies

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

4. Shell Programming and Scripting

preserving the timestamp of a file when copied from remote server to local server using ftp

Hi, I need to copy few files from remote server to local server. I write a shell script to connect to the remote server using ftp and go to that path. Now i need to copy those files in the remote directory to my local server with the timestamp of all those files shouldnt be changed. ... (5 Replies)
Discussion started by: arunkumarmc
5 Replies

5. Shell Programming and Scripting

Script to check file update on ftp server

Hi everybody, Is there a way to do a stat of files on a ftp server? I have a database which is populated by the contents of these files. I want to setup a crontab to check if there has been an update to these files. If the file has been updated I will download it and then update my database. ... (2 Replies)
Discussion started by: z1dane
2 Replies

6. Shell Programming and Scripting

Contantly check for file at the remote server and ftp when avaliable

Hello, I used the search engine but could not find the solution I am looking for. Probably its simple but I do not know the solution. My requirement is I ftp files every day in the morning from the remote server to the local machine. Now if the files are not there at the time I schedule the ftp... (2 Replies)
Discussion started by: kiran_418
2 Replies

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

8. Shell Programming and Scripting

Shell script for FTP a file from one server to another server

Hi Can any one help me for script. I need a script and this script has to execute daily to move the files. FTP from one server to another server EX: Sep 10 06:24 abc.txt Sep 11 06.56 abc.txt Sep 12 08.23 abc.txt these files are located at a/b/c/e/f in 123 server and copy... (0 Replies)
Discussion started by: mahantysk
0 Replies

9. Shell Programming and Scripting

Dowloading a File from FTP Server to a local Server where User Id's are different

Hi, The Setup is like this. I'm connecting to Unix machine from my local machine. After connecting to Unix M/c, i need to connect FTP server. Am successful in connecting to FTP server, but am not able to download the file from the ftp server to my local machine. I have different user id's and... (1 Reply)
Discussion started by: ranjith_taurean
1 Replies

10. Shell Programming and Scripting

how to move a file from one server to another server using FTP in shell script?

I have a file --> file1.txt i need to copy this file to another server using FTP....the 2 servers are server1 and server2..may i know how to write a script that can do this? thanks in advance! Im a newbie to this... (4 Replies)
Discussion started by: forevercalz
4 Replies
Login or Register to Ask a Question