[Gllug] Smart directories: Cron or fancier

Jan Kokoska kokoskaj at seznam.cz
Mon Sep 27 14:01:35 UTC 2004


Most likely, just just want cron + imagemagick/gimp fu for filesystem
approach, e-mailing the images as someone suggests would of course get
rid of the problem of updating fs completely - if you can use that.

Otherwise you can use some ugly approach that would let you spy on
syscalls in kernel and attach events to them, I successfully used:
http://www.bangstate.com/changedfiles/

It was not very fast, as I was doing some silly replication through FTP,
about 10 files/sec (using a shell script with multiple execs per event,
heh). Proof of concept really, you don't need to tell me FS replication
is not done this way.

There is a kernel module and deamon configured by you, doing some ugly
stuff on event of syscalls touching your files. The moment of finishing
updating something is clear, but it really comes down to your
willingness to let some resource hog like this enter your kernel space
in the first place. Under heavy load the system could just go belly up
and you end up debugging a kernel module so think twice... cron ought to
be just fine.

Another approach in asynchronous communication in general is shared
memory, even PHP has shmem functions.. and you can have the apps poll
shmem in some reasonable loop which would be as realtime as it gets.
Large apps are done this way, but again, terrible development overhead
for your sort of problem.

Regards,

Jan Kokoska

-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list