Giter Club home page Giter Club logo

facron's Introduction

facron is a new generation filesystem cron

See http://www.imagination-land.org/posts/2012-12-04-facron-fanotify-cron-system.html and 
http://www.imagination-land.org/posts/2012-12-07-facron-released.html for more details.

To build facron:

git clone git://github.com/Keruspe/facron.git
cd facron
./autogen.sh
./configure --sysconfdir=/etc --with-systemdsystemunitdir=/usr/lib/systemd/system
make
sudo make install

facron configuration file is "/etc/facron.conf".
You can put as many entries as you want in this file, one entry per line.
Each line must be formatted like this:

<file path> <fanotify masks> <command>

Each time we receive an event matching the fanotify masks on the file path given, the
command is launched.

The fanotify masks available are:

    FAN_ACCESS
    FAN_MODIFY
    FAN_CLOSE_WRITE
    FAN_CLOSE_NOWRITE
    FAN_OPEN
    FAN_Q_OVERFLOW
    FAN_OPEN_PERM
    FAN_ACCESS_PERM
    FAN_ONDIR
    FAN_EVENT_ON_CHILD
    FAN_CLOSE
    FAN_ALL_EVENTS
    FAN_ALL_PERM_EVENTS
    FAN_ALL_OUTGOING_EVENTS

If you configure your fanotify masks like this:

    FAN_MODIFY|FAN_CLOSE_WRITE,FAN_OPEN

The event caught will be either FAN_MODIFY AND FAN_CLOSE_WRITE, or FAN_OPEN

The command should be an absolute path. You can pass it arguments.
If any of your arguments contain sapces, you can surround it with quotes or double quotes.
Four special arguments are available:

    $@ corresponds to the dirname of your file
    $# corresponds to the basename of your file
    $$ corresponds to the full path of your file
    $* corresponds to the process id that accessed the file

Three additional arguments are available which handle a global counter:

    $+ increments the counter and returns its new value
    $- decrements the counter and returns its new value
    $= returns its value

You can reload the configuration at any time by sending a SIGUSR1 to facron:

    kill -USR1 $(pidof facron)

facron's People

Contributors

keruspe avatar nsydenham avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.