Friday 9 December 2011

When writing to file, send contents to an application

When writing to file, send contents to an application

Hi, heres a challenge for you...

I have a file: /opt/server/access.log

And whenever anything goes to write to access.log I want it to send each line to /usr/bin/accesslog X

For example, if you where appending this to the file:

Code:

[Server] Ding
[Server] Dong
[Server] Blah

It would instead do this:

Code:

/usr/bin/accesslog [Server] Ding
/usr/bin/accesslog [Server] Dong
/usr/bin/accesslog [Server] Blah

If I sound like a maniac just tell me, but I know nothings* impossible.

Any ideas? Thanks!

* To a proportion, don't quote me.

No comments:

Post a Comment