Re: How to make sure that the target file to read is not under writing by others?
| From: | Tom Worster | Date: | Wed, 19 Aug 2009 13:28:47 +0000 |
| Subject: | Re: How to make sure that the target file to read is not under writing by others? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-296964@lists.php.net to get a copy of this message | ||
On 8/19/09 3:55 AM, "Dengxule" <dengxule@gmail.com> wrote:
> I have a crontab command to execuate my php-script every half an hour.
>
> The mission of the php-script is to open a file(log file), examine it.
>
> The target file(log file) is transported to local every half an hour.
>
> I've no idea how much time it will costs and on the other hand, i want to
> make sure the file i'm openning is Completely Written.
>
> Any instruction will be grateful.
perhaps you could use cronolog (http://cronolog.org/) to rotate the log
files every half hour? that way you could be sure that the file you open to
process/copy is one that cronolog has finished writing to.