Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

A lightweight cron job scheduler with webhook notifications, designed for easy task automation and flexible scheduling

License

NotificationsYou must be signed in to change notification settings

ostafen/kronos

Repository files navigation

Overview

Kronos is a powerful cron job webhook scheduler that allows you to define and manage scheduled tasks with ease. Utilizing a simple JSON-like DSL, Kronos makes it easy to schedule webhooks and automate workflows seamlessly.

Features:

  • ✨ Simple DSL: Define your workflows using a clear, JSON-like syntax.

  • ⚡ REST API Integration: Schedule and manage webhooks easily.

  • 🚀 Distributed Execution: Run tasks across multiple environments.

  • ⏰ Flexible Scheduling: Create complex scheduling patterns with cron expressions.

Screen

Build (Go 1.9+)

Run the following command

foo@bar$ make build

to build an executable which will be output to thebin subfolder.

Yaml file configuration

logging:level:INFOformat:JSONport:9175store:path:"/path/to/db/file"# default is kronos.bolt

Docker compose configuration

services:kronos:image:ghcr.io/ostafen/kronosports:      -'9175:9175'environment:      -PORT=9175# configuration properties can be overridden through environment variables      -STORE_PATH=/data/kronos.boltvolumes:      -./data:/data

Registering a periodic schedule

To start getting some webhook notifications, let's add a new schedule which will be notified every minute:

curl -X POST localhost:9175/schedules -H'Content-Type: application/json' -d \'{    "title": "sample-schedule",    "description": "a sample schedule description",    "cronExpr": "0/1 * * * *",    "url": "your-webhook-address",    "isRecurring": true,    "startAt": "2023-02-19T11:34:00Z",    "endAt": "2023-02-19T11:38:00Z"}'

On success, the response of the server will be similar to the following:

{"id":"1e6d146b-e3b7-4e5c-b7ce-b7b2860f461b","title":"sample-schedule","status":"not_started","description":"a sample schedule description","cronExpr":"0/1 * * * *","url":"your-webhook-address","metadata":null,"isRecurring":true,"createdAt":"2023-02-19T12:32:30.788562107+01:00","runAt":"0001-01-01T00:00:00Z","startAt":"2023-02-19T11:34:00Z","endAt":"2023-02-19T11:38:00Z","nextScheduleAt":"2023-02-19T11:34:00Z",}

The above table contains the full list of supported fields:

ParameterRequiredDescription
titletruethe name of your schedule. It must be unique.
descriptionfalsean optional description of your schedule.
isRecurringfalsewhether the schedule is recurring or not.
cronExprif isRecurring = truecron expression for recurring schedules.
urltruewebhook notification endpoint.
runAtif isRecurring = falsefor non-recurring schedules, it indicates the instant the schedule will be triggered at.
startAtfalseUTC start date of the schedule. Must be equal to runAt if isRecurring = false.
endAtfalseUTC end date of the schedule. Must be equal to runAt if isRecurring = false.
metadatafalseoptional metadata which will be sent when triggering a webhook.

REST API

  • POST/schedules - Register a new schedule
  • GET/schedules/{id} - Get details about an already existing schedule
  • DELETE/schedules/{id} - Delete a schedule
  • POST/schedules/{id}/pause - Pause an active schedule
  • POST/schedules/{id}/resume - Resume a paused schedule
  • POST/schedules/{id}/trigger - Immediately trigger a notification for a given schedule

Contact

Stefano Scafiti @ostafen

License

Kronos source code is available under theMIT License.

About

A lightweight cron job scheduler with webhook notifications, designed for easy task automation and flexible scheduling

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

[8]ページ先頭

©2009-2025 Movatter.jp