Shell script running as a daemon?

Ronnie Gauthier linux
Wed Jul 18 18:17:45 PDT 2007


On Thu, 19 Jul 2007 00:51:08 +0000 (UTC)
Mateus Interciso <p.zarnick at gmail.com> wrote:

> Hello, I'm planing on making a (hopefully) simple shell script that act 
> as a daemon. This particular shell script should keep watching a folder, 
> and wenever a new txt file(all files that arrive on that folder are txt) 
> arrives, it should grep trough it, and take some actions.
> My question is if it's possible to make this kind of daemon?
> Any suggestions?Feebacks?
> 

How are the files getting dropped into the folder?
If web based perhaps php or perl and have it do its thing upon uploading
the file.

Cronjob the script? 
Use a folder for temp storage and have the script move the file to another
folder at completion. This way the script only has to check if the folder 
is empty instead of running through each file checking the date or indexing 
them.

Ronnie



More information about the Linux-users mailing list