Sam Gleske on 16 Jan 2013 08:08:14 -0800


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] General "incoming" file processor or framework?


On Sat, Jan 12, 2013 at 1:02 AM, JP Vossen <jp@jpsdomain.org> wrote:
Is anyone aware of any kind of general "incoming" file processor or framework?  I'm not talking about 'inotify' but something more like:

1) Notice an arbitrary file has appeared in an arbitrary location
        1.1) Maybe by using inotify, but that's not the point
2) Perform some arbitrary action on the file based on arbitrary rules

One use-case would be for "write only" storage for log or audit data for PCI compliance.  So you transmit the data as a tarball into some writeable directory via scp or whatever, and the file is picked up, hashed, manifested, processed or just moved to a read-only archive location from which it may be later downloaded if needed.

It's not all that hard to do, but it seems like a reasonably obvious task that may already exist, but if so I'm not finding it.  Years ago I might have looked for something called a "drop box" but these days that term is swamped into uselessness...

I would need something small and stand-alone, something built into a giant framework like Rails or Zope is unnecessary overkill.

Clues?  Thanks,
JP


I would probably go with...

Cron every couple of minutes or seconds with a bash script.  Or write a daemon script which sleeps every 30 seconds and checks the directory.  The daemon script could be started like so...

su - someuser -c "/path/to/daemon/script.sh" &

Then just log out and let it go.  The sleep time in the bash script can be adjusted to desired intervals.

That's how I would do it.  If you're looking at using inotify then check out incrond.  It's a cron-like scheduling system for inotify events.

SAM
___________________________________________________________________________
Philadelphia Linux Users Group         --        http://www.phillylinux.org
Announcements - http://lists.phillylinux.org/mailman/listinfo/plug-announce
General Discussion  --   http://lists.phillylinux.org/mailman/listinfo/plug