mirror of
https://github.com/nxshock/gron.git
synced 2024-11-27 03:41:00 +05:00
SystemD and cron inspired job scheduler
tests | ||
webui | ||
.gitattributes | ||
.gitignore | ||
config.go | ||
consts.go | ||
db.go | ||
go.mod | ||
go.sum | ||
gron.conf | ||
httpserver.go | ||
job_test.go | ||
job.go | ||
jobtype.go | ||
LICENSE | ||
log.go | ||
main.go | ||
make.bat | ||
README.md | ||
restartrule_test.go | ||
restartrule.go | ||
status.go | ||
template.go |
gron
SystemD and cron inspired job scheduler
Usage
-
Create
gron.d
directory -
Create job config in
gron.d/job1.conf
(TOML format):Type = "cmd" # command execution Cron = "* * * * *" # cron instructions Command = "echo Hello" # command to execute
SQL job:
Type = "sql" # sql execution Cron = "* * * * *" # cron instructions Description = "execute procedure every minute" # job description Driver = "pgx" # "pgx" for Postgresql, "oracle" for Oracle, "sqlserver" for Microsoft SQL Server ConnectionString = "postgres://login:password@host:port/database?sslmode=disable" # each driver has different syntax SqlText = "CALL procedure" # command to execute
Add other options if needed:
Description = "print Hello every minute" # job description NumberOfRestartAttemts = 3 # number of restart attemts RestartSec = 5 # the time to sleep before restarting a job (seconds) RestartRule = "on-error" # Configures whether the job shall be restarted when the job process exits
-
Launch
gron
binary -
HTTP interface available on http://127.0.0.1:9876