Sign inSign up

10sr/cron-js

By 10sr

•Updated over 9 years ago

Cron Command Implemented in Nodejs

Image
0

942

10sr/cron-js repository overview

NPM version Downloads Build Status Dependency Status

⁠cron-cli-js

Cron command implemented in Nodejs

⁠Overview

Write your crontab file as:

00 30 11 * * 1-5 echo foo
10 23 0-23/2 * * * echo bar 1>&2

And start cron in foreground with that crontab file:

$ cron ./crontab

⁠Usage

⁠Commandline Options
$ cron [--exit-on-failure] [--timezone <timeZone>] <crontab>
OptionDefaultDescription
--exit-on-failure(None)When given and any of jobs ends with status code other than 0, exit cron program with that status code
--timezone <timeZone>(None)When given, set timezone for cron jobs
⁠Crontab Format

A sample crontab file will look like:

# sec min hour day month day-of-week command
# Runs every weekday (Monday through Friday) at 11:30:00 AM
00 30 11 * * 1-5 echo foo
# Runs 23 minutes 10 seconds after midn, 2am, 4am ..., everyday
10 23 0-23/2 * * * echo bar 1>&2

Where each number represents seconds, munites, hours, day of month, months and day of week respectively. All trailing texts are treated as shell command to execute.

Lines that start with # are treated as comments and are ignored.

Jobs are scheduled with node-cron⁠, so see its document for details about available cron time format.

Specifying environment variables in crontab file is not supported.

⁠License

Copyright (c) 2017 10sr [email protected]⁠

This software is licensed under the Apache License, Version 2.0 , see LICENSE for details.

Tag summary

Content type

Image

Digest

Size

22.2 MB

Last updated

over 9 years ago

docker pull 10sr/cron-js