tasker
An LFE application for running recurring tasks
Table of Contents
About ↟
The tasker tool simply takes configuration that describes one or more OS CLI calls and executes them reguarly at the configured interval. Task metadata takes the following form:
[{name, String},
{cmd, String},
{args, [term] | []},
{interval, Integer}
]And a complete configiration takes the form:
[{tasker,
[{tasks, [metadata, ...]}]
}].
See ./priv/examples for working configs.
Build ↟
Note that, due to the use of the safer timer:apply_repeatedly, this project requires Erlang 26 or later.
$ rebar3 lfe compileStart the Project REPL ↟
$ rebar3 lfe replTests ↟
$ rebar3 as test lfe testUsage ↟
Run the date example, calling out to the shell every 5 seconds to get the system date:
erl -noshell -pa $(rebar3 path) \
-config priv/examples/shell-date.config \
-run tasker startRun the example that configures multiple recurring tasks:
erl -noshell -pa $(rebar3 path) \
-config priv/examples/multiple.config \
-run tasker startFor convenience, a shell script has been added that allows one to run a config like so:
./bin/tasker priv/examples/multiple.configAn alternative that executes the call as a background OS process:
./bin/taskerd priv/examples/multiple.configLicense ↟
Apache License, Version 2.0
Copyright © 2023, Duncan McGreggor oubiwann@gmail.com.