dazuko-help
[Top][All Lists]
Advanced

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

Re: [Dazuko-help] Dazuko 2.3.4 and FreeBSD 6.2


From: John Ogness
Subject: Re: [Dazuko-help] Dazuko 2.3.4 and FreeBSD 6.2
Date: Tue, 05 Feb 2008 12:33:21 +0100
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (berkeley-unix)

On 2008-02-05, Mark W. de Raad <address@hidden> wrote:
> If you (or another reader) have time for a question, our purpose is:
>
>   Monitor a directory of files
>   Notice any file changes within that directory
>   Initialise a replication process (separate program)
>
> We were hoping to use CLOSE_MODIFIED to only trap the files that
> have changed (apart from simply being accessed).
>
> Regarding the move of CLOSE_MODIFIED to the userland, would you
> recommend storing the file information in a database? DB2? Mysql?

I do not have any _real_ database experience so I can't offer any
suggestion here.

> I presume trigger a process whenever a CLOSE event is trapped (we do
> not always seem to get OPEN events for some reason, particularly
> when data is appended to a file)

It would be helpful if you could provide a reproducable example of a
situation where OPEN is not generated. Also be aware that symbolic
links may play a role. For example, on FreeBSD it is typical that
/home is a symbolic link to /usr/home. If Dazuko is monitoring /home
and another application access a file with the path /usr/home/... then
Dazuko will not see it. The same is for the reversed situation.

> We would also need to generate a checksum I presume - would you
> recommend CRC or MD5? (speed is a factor of course).

A very quick test is to look at the information returned by the
stat(2) function. If everything is the same (except probably the
atime) then it is probably safe to assume the file has not
changed. This depends on the filesystem being used, but may serve as
an excellent optimization.

John Ogness

-- 
Dazuko Maintainer




reply via email to

[Prev in Thread] Current Thread [Next in Thread]