Hello: I have a server set up a CentOS 5 server for a client to push files onto using FTP. I have a cron job to process the files and move them to another directory. Sometimes, the cron job executes while the client is still uploading a file (Some of them can be large) and I get a partial file. Is there a way to tell when a file has finished uploading? I am using the vsftpd daemon installed using yum. Thanks, Neil -- Neil Aggarwal, (832)245-7314, www.JAMMConsulting.com Eliminate junk email and reclaim your inbox. Visit http://www.spammilter.com for details.
> Is there a way to tell when a file has finished > uploading? >One thought that comes to mind is to upload a file containing the md5sums of the other files. Your script would then read the check file and compare the md5sum of each file with the one recorded in the check file. Good files are copied, bad files are left until the next time. Shawn
Ignacio Vazquez-Abrams
2007-Nov-11 23:08 UTC
[CentOS] How to know when files have finished FTPing?
On Sun, 2007-11-11 at 13:20 -0600, Neil Aggarwal wrote:> ...CentOS 5...> I have a cron job...> Is there a way to tell when a file has finished > uploading?http://incron.aiken.cz/ -- Ignacio Vazquez-Abrams <ivazqueznet at gmail.com> PLEASE don't CC me; I'm already subscribed -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 189 bytes Desc: This is a digitally signed message part URL: <http://lists.centos.org/pipermail/centos/attachments/20071111/0ed6e5fd/attachment.sig>
Karanbir Singh
2007-Nov-11 23:49 UTC
[CentOS] How to know when files have finished FTPing?
Neil Aggarwal wrote:> Is there a way to tell when a file has finished > uploading?how about just watching the logfile rather than the file directory ? the log entry for a file is only written once the file has completed... since it includes the file size and status of transfer. - KB -- Karanbir Singh : http://www.karan.org/ : 2522219 at icq
On Nov 11, 2007 2:20 PM, Neil Aggarwal <neil at jammconsulting.com> wrote:> Hello: > > I have a server set up a CentOS 5 server for a client > to push files onto using FTP. > > I have a cron job to process the files and > move them to another directory. > > Sometimes, the cron job executes while the client > is still uploading a file (Some of them can be large) > and I get a partial file. > > Is there a way to tell when a file has finished > uploading? > > I am using the vsftpd daemon installed using yum. > > Thanks, > NeilWow, all quite involved answers. You may be able to get the list of files to process using 'find'. If you check using "-mmin +X", you might be able to get only files that haven't been updated in X minutes. That should filter out anything in progress. If a transfer is stopped in the middle, then restarted later, that wouldn't help here. It's possible that the FTP daemon might not update this information, so you'll have to expieriment. It's worth a shot before you start telling the client to modify their process.