Using guard as a production service

33 views
Skip to first unread message

Niels

unread,
Jan 10, 2012, 1:28:32 AM1/10/12
to guard-dev
Hi All,

I have been using guard in it's classic roll to speed up development
(mostly for tests). This works great - thanks!

Now I am wondering if it would be appropriate to use it in production
setting. For example you might want to process a file as soon as it is
delivered to a specific directory by an external process (perhaps by
ftp). In the past I have set up a daemon that checks the directory
ever so often. But wouldn't it be better (i.e. faster, fewer
resources?) to use file system notification to trigger the processing?

In this case you would want to run guard as a service always running
in the background waiting for a specific file system event to occur.

Does anyone do this? Is there some hidden problem with using it like
this? Is there better alternative?

Thanks in advance for you help,

Niels

Michael Kessler

unread,
Jan 10, 2012, 4:22:49 AM1/10/12
to guar...@googlegroups.com
Hi Niels

A FTP server writes the received file data in several chunks, so it'll trigger multiple events on the same file. I think adding a hook the the FTP server itself is a better solution.

On a server I'd prefer to go directly with the command line tools like `inotifywatch`, so there's no overhead with a full blown Ruby process.

Michael

Reply all
Reply to author
Forward
0 new messages