Donald Russell wrote:
Another system uses FTP to drop files in a directory for me to process.
I have a bash script to process the incoming files. The script is started by cron periodically.

There's a problem if the FTP transfer is still in progress because the process begins reading the file even though it isn't complete yet.
Do you have control of the FTP procedure that drops the files? If so, transfer the files with one filename, and when complete, use ftp to rename the file. The rename is atomic. e.g.:
put foo.bar foo.bar.xfer
rename foo.bar.xfer foo.bar

Then have the cron job only process files without the .xfer appended to name.

Chris

--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines

Reply via email to