cronolog
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

cronolog

A simple light-weight cron-based task runner.

Features

  • Schedule numerous named tasks using the cron syntax.
  • Specify dependencies between tasks.
  • Humanizes cron specifications so that we can understand them!

Install

npm install -g cronolog

Use

Create a task specification file (see next section).

Run cronolog from the same directory as the task specification file:

cronolog

Scheduled tasks will be run at their specified times.

Task specification

This is a json file called cronolog.json that specifies which tasks to run and when.

{
    "my-task": {
        "when": "<cron-specification>",
        "cmd": {
            "exe": "<the path to a executable to run>",
            "args" [
                "list of arguments to pass to the command",
                "arg 2",
                "arg 3, etc"
            ],
            "cwd": "<the-working-directory-for-the-command>"
        },
        "dependsOn": "my-other-task"
    },

    "my-other-task": {
        ... another task defined here ...
    },
}

Logging

Logging generated by tasks is stored in the output sub-directory next to the task specification file.

Future

  • Tasks can be coded in JavaScript.
  • Use as an API.
  • Built-in web page for viewing logs.
  • Configuration of tasks via the webpage.
  • Emails when tasks complete or fail.
  • Email digests.
  • Easily deployable to Azure and AWS.
  • Triggerable by web hook.
  • Tasks specification can be defined in both JSON and JavaScript.
  • Tracking the duration of the tasks to let you know how long they take and if they are getting shorter/longer.
  • Plugins so that logging can be redirected offsite.
  • Watch and restart when the task spec is updated.
  • Automatically resolve and break circular dependencies.

Readme

Keywords

none

Package Sidebar

Install

npm i cronolog

Weekly Downloads

0

Version

1.1.0

License

MIT

Unpacked Size

57.8 kB

Total Files

33

Last publish

Collaborators

  • ashleydavis