I had to do a similar thing and what I did was similar to your proposal.  I
had the advantage that all the files arriving were to be downloaded then
deleted from the remote site.

John Weller
01380 723235
07976 393631  

> Any suggestions on a best practice way to monitor a remote 
> FTP site for the arrival of new/updated files? I don't need 
> specific code, just some coaching on technique based on your 
> real-world experience including suggestions for a utility vs. 
> code based solution.
> My goal is to maintain a local collection of files synced 
> with a remote FTP site and when I download a new/updated file 
> locally, run a script to process it. The arrival and format 
> of the files that I need to sync with are beyond my control 
> (eliminating a rsync solution) ... all I have is a generic 
> FTP connection to a specific FTP address. Note: The remote 
> site I'm monitoring may have multiple uploads occurring at 
> the same time.
> My high level strategy is to poll the remote directory on a 
> regular basis and compare the new directory listing to a 
> previous snapshot of the directory listing. If a file 
> timestamp or size has changed (or a new file has appeared), 
> then track this file as a changed file. Once a file has been 
> marked as changed, wait <N> polling cycles for the file 
> timestamp and size to remain stable, then download it, and 
> trigger a local script to process the file.
> In addition to detecting new or changed files, I would 
> compare remote directory listings to my local sync folder and 
> delete local files that no longer exist on the remote site.
> My concern about using a 3rd party utility is the utility's 
> ability to detect when a remote file has finished being updated.
> I don't want to download files that are still in the process 
> of being updated - I only want to download new/updated files 
> after they've been closed on the remote site.


_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/profox
OT-free version of this list: http://leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/6d8b83757bcc4b0190467f06db7b9...@wessex1
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to