Program made in Go to handle Best Mod's tasks via sending HTTP requests to a REST API.
The following command line options are available from the help menu.
./tasks --cfg <cfgFile> --list --version --help
--cfg => Path to config file. Default path is /etc/bestmods-tasks/tasks.conf.
--list => Lists configuration file.
--version => Prints the current version.
--help => Prints the help menu.
The configuration file is parsed using JSON
. Here is a config example.
{
"debug": 2,
"tasks": [
{
"cronstr": "* * * * * *",
"url": "mydomain.com",
"auth": "Bearer TEST",
"method": "GET"
}
]
}
- debug - Debug level from
0
-3
. - tasks - An array of tasks to schedule via Cron.
- cronstr - The cron string to schedule (read more here).
- url - URL to send our HTTP/HTTPS request to.
- auth - What to set the
Authorization
header to within the request. - method - HTTP method (e.g.
GET
,POST
, etc.).
Building is simple via git
and go build
.
# Clone repository.
git clone https://github.com/bestmods/tasks
# Change directory.
cd tasks
# Build to `./tasks`.
go build -o tasks
- Christian Deacon - Creator