Name

rehctaw - Execute system commands according to file contents.

Description

rehctaw watches contents of a file, and executes system commands according to those contents. The commands, intervals, ... are provided in a YAML configuration file which is also watched.

Example

The sample configuration file can be found under ./examples/ directory. To use this example, type

$ cp ./examples/simple.yaml ./examples/mine.yaml
$ ./bin/rehctaw ./examples/mine.yaml

On another terminal, type for examples

$ echo foobar > /tmp/watcher
$ echo reload > /tmp/watcher

You will see some notifications from the output of rehctaw command.

You can update the file ./examples/mine.yaml. The program will use new settings in the next check.

License

MIT

Author

Anh K. Huynh

History

The idea comes from some Rails framework. When a Rails application is running, you can quickly send a reload signal to it, by touching a file. See ChiliProject for an example.

I don't want to use inotify, because that works at file system level and it may cause some issues when the file is renamed.