Doug Stewart on 25 Mar 2014 11:10:56 -0700


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] check for a file being transmitted via ftp


Does `lsof | grep filename` not work?

--
Doug Stewart

> On Mar 25, 2014, at 2:05 PM, "Eric at Lucii.org" <eric@lucii.org> wrote:
> 
> I expect a file to be routinely transmitted to me via ftp.  A bash script,
> invoked as a cron job, will process and then archive that ftp file.
> 
> All of that is easy/routine.
> 
> My question is: how do I know that the file is complete?  I don't want to
> start processing the file without being sure that the ftp process is done.
> 
> I thought about checking the size of the file in bytes and then comparing that
> to it's size 1 minute earlier... if it's not growing then it's probably done.
> But, that's just *probably* as ftp could be stalled temporarily or worse.
> 
> I have also considered about using inotify cron (incron) but I expect that it
> would be triggered at the file's creation - not when it's time for me to
> process it.
> 
> Thanks
> Eric
> -- 
> #  Eric Lucas
> #
> #                "Oh, I have slipped the surly bond of earth
> #                 And danced the skies on laughter-silvered wings...
> #                                        -- John Gillespie Magee Jr
> ___________________________________________________________________________
> Philadelphia Linux Users Group         --        http://www.phillylinux.org
> Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
> General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug