Results 1 to 2 of 2
lftp is reading the files which are being created and want to avoid that. Is there is way I can config lftp to read only the files which have reached ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 11-10-2009 #1
- Join Date
- Nov 2009
How to read only files which have end of file using lftp from a folder?
lftp is reading the files which are being created and want to avoid that. Is there is way I can config lftp to read only the files which have reached end of the file in a folder. My ftp source system generates several files and we have a batch shell script which pings the source for every 30 secs and reads the file using the newer than option, lftp reading the larger files which are being created in every 30 seconds even though the file is not fully populated by source.
any help would be appriciated
thx - bmk
- 11-10-2009 #2
- Join Date
- Apr 2009
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
Unlike Windows, there is no "end-of-file" marker in Linux files. The design of the system allows reading/editing of partially written files. Sorry, but you are out of luck on this. You could change your script/application that creates the files to put the new ones in a temporary directory inaccessible by lftp and then move them into the accessible directory once they are finished being written to.Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!