[Freeswitch-users] failover when storing recordings

Gabriel Gunderson gabe at gundy.org
Sat Dec 29 12:32:27 MSK 2012


On Thu, Dec 27, 2012 at 5:36 PM, Michael Collins <msc at freeswitch.org> wrote:
> You're better off doing a cron job that copies the files to the target host,
> confirms they made it, then deletes the files from the local host (i.e. the
> FreeSWITCH box).

I'm a fan of inotify's incron:
http://inotify.aiken.cz/?section=incron&page=doc&lang=en

Basically you configure incron to watch the files and dirs that you
care about, and when it sees the type of activity that you're looking
for, it will call the scripts that you'd like run on them.

This will save me some typing, but give you a feel for how it works;
from the docs:
####################################################################

The user table rows have the following syntax (use one or more spaces
between elements):
<path> <mask> <command>

Where:
<path> is a filesystem path (each whitespace must be prepended by a backslash)
<mask> is a symbolic (see inotify.h; use commas for separating
symbols) or numeric mask for events
<command> is an application or script to run on the events

The command may contain these wildcards:
$$ - a dollar sign
$@ - the watched filesystem path (see above)
$# - the event-related file name
$% - the event flags (textually)
$& - the event flags (numerically)

The mask may additionaly contain a special symbol IN_NO_LOOP which
disables events occurred during processing the event (to avoid loops).

Example: You need to run program 'abc' with the full file path as an
argument every time a file is changed in /var/mail. One of the
solutions follows:

/var/mail IN_CLOSE_WRITE abc $@/$#
####################################################################

Hope that helps.


Best,
Gabe



Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list