monitor util in a scripted daemon?

2010-07-23 Thread Neil Smith
- Is there a command (native, shell, or ports collection) to sit and watch for 
new file creation in a directory?
- I'd like to build a system startup script for such a command and its scripted 
actions. Sound possible?
- Is there already something in the default OS that does something similar?


Thanks,
-Neil
---
Neil Smith ne...@tamu.edu
Comp. Sys. Mngr., Atmospheric Sciences



___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: monitor util in a scripted daemon?

2010-07-23 Thread Greg Larkin
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Neil Smith wrote:
 - Is there a command (native, shell, or ports collection) to sit and watch 
 for new file creation in a directory?
 - I'd like to build a system startup script for such a command and its 
 scripted actions. Sound possible?
 - Is there already something in the default OS that does something similar?
 
 
 Thanks,
 -Neil
 ---
 Neil Smith ne...@tamu.edu
 Comp. Sys. Mngr., Atmospheric Sciences

Hi Neil,

I haven't used it yet, but gamin should do the trick:
http://www.freshports.org/devel/gamin/

I don't see why you couldn't wrap it with a startup script so a list of
monitored files/directories could be added to /etc/rc.conf.

Hope that helps,
Greg
- --
Greg Larkin

http://www.FreeBSD.org/   - The Power To Serve
http://www.sourcehosting.net/ - Ready. Set. Code.
http://twitter.com/sourcehosting/ - Follow me, follow you
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFMSf770sRouByUApARAkOAAJwIGJt4trCutsSGCugzGjB93yZx8ACgjdOe
o1tEuLiA8wanazn9MlsS3DE=
=n83K
-END PGP SIGNATURE-

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org


Re: monitor util in a scripted daemon?

2010-07-23 Thread Matthew Seaman
On 23/07/2010 20:58:06, Neil Smith wrote:
 - Is there a command (native, shell, or ports collection) to sit and watch 
 for new file creation in a directory?

gamin -- http://people.gnome.org/~veillard/gamin/

 - I'd like to build a system startup script for such a command and its 
 scripted actions. Sound possible?

It's in ports already.  Doesn't appear to have a separate rc script --
it's part of gnome, and would get run along with those applications.

 - Is there already something in the default OS that does something similar?

Look at kevent(2), kqueue(2) -- the EVFILT_VNODE filter can be used to
pick up changes to the link count of a directory: ie that a file has
been created or destroyed within it. Some C programming required.  AFAIK
there isn't a ready built application in the base OS to do what you want.

Cheers,

Matthew

-- 
Dr Matthew J Seaman MA, D.Phil.   7 Priory Courtyard
  Flat 3
PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate
JID: matt...@infracaninophile.co.uk   Kent, CT11 9PW



signature.asc
Description: OpenPGP digital signature


Re: monitor util in a scripted daemon?

2010-07-23 Thread Steve Szabo
Tripwire?

On Fri, Jul 23, 2010 at 2:58 PM, Neil Smith ne...@tamu.edu wrote:
 - Is there a command (native, shell, or ports collection) to sit and watch 
 for new file creation in a directory?
 - I'd like to build a system startup script for such a command and its 
 scripted actions. Sound possible?
 - Is there already something in the default OS that does something similar?


 Thanks,
 -Neil
 ---
 Neil Smith         ne...@tamu.edu
 Comp. Sys. Mngr., Atmospheric Sciences



 ___
 freebsd-questions@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/freebsd-questions
 To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org

___
freebsd-questions@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to freebsd-questions-unsubscr...@freebsd.org