Re: How to determine if a file is in use

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

 



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@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Guidelines: http://fedoraproject.org/wiki/Communicate/MailingListGuidelines

[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux