[CLUE-Tech] how to handle open files - upload server
    Dan Harris 
    coronadh at coronasolutions.com
       
    Tue Jan 13 13:13:53 MST 2004
    
    
  
Nate Duehr wrote:
>Here's an interesting one, or maybe I'm just not creative enough today.  I 
>have a Linux server where people upload some files to me for processing 
>(using sftp).  The files show up, I move them to another machine to do 
>the dirty work.  Simple, right?  Move those files elsewhere after they 
>arrive, which can pretty easily be done from a cron job, no problem 
>there.
>
>  
>
I had this EXACT same issue to deal with.  What I do is before doing 
anything with the file, I grep the filename through the 'lsof' program 
and make sure it's not listed.  If it's still being uploaded, it will 
show up in that output, sleep or something until it finishes.
-Dan
    
    
More information about the clue-tech
mailing list