{"id":20511570,"url":"https://github.com/10sr/cron-cli-js","last_synced_at":"2025-08-05T06:30:26.042Z","repository":{"id":57141501,"uuid":"90639079","full_name":"10sr/cron-cli-js","owner":"10sr","description":"Simple Cron Command Implementation in Nodejs","archived":false,"fork":false,"pushed_at":"2017-06-15T13:40:31.000Z","size":54,"stargazers_count":2,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-05T20:05:11.738Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/cron-cli","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/10sr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-05-08T14:43:26.000Z","updated_at":"2023-11-20T16:57:41.000Z","dependencies_parsed_at":"2022-09-03T07:01:26.415Z","dependency_job_id":null,"html_url":"https://github.com/10sr/cron-cli-js","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/10sr/cron-cli-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/10sr%2Fcron-cli-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/10sr%2Fcron-cli-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/10sr%2Fcron-cli-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/10sr%2Fcron-cli-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/10sr","download_url":"https://codeload.github.com/10sr/cron-cli-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/10sr%2Fcron-cli-js/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259465316,"owners_count":22862076,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-15T20:36:25.277Z","updated_at":"2025-06-12T12:33:25.959Z","avatar_url":"https://github.com/10sr.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/10sr/cron-cli-js.svg?branch=master)](https://travis-ci.org/10sr/cron-cli-js)\n[![NPM version](http://img.shields.io/npm/v/cron-cli.svg)](https://www.npmjs.com/package/cron-cli)\n[![Dependency Status](https://david-dm.org/10sr/cron-cli-js.svg)](https://david-dm.org/10sr/cron-cli-js)\n[![Downloads](https://img.shields.io/npm/dm/cron-cli.svg)](https://www.npmjs.com/package/cron-cli)\n[![Docker Pulls](https://img.shields.io/docker/pulls/10sr/cron-js.svg)](https://hub.docker.com/r/10sr/cron-js)\n[![](https://images.microbadger.com/badges/version/10sr/cron-js.svg)](https://microbadger.com/images/10sr/cron-js \"Get your own version badge on microbadger.com\")\n\n\n\nCRON_JS\n=======\n\nSimple cron command implementation in Nodejs\n\n\n* Define job schedules in standard crontab-like format\n  * Extended to support seconds digit\n* No \"daemon mode\": all status informations are printed to stdout,\nincluding outputs of executed jobs\n* Support email for sending job results: both sendmail command and SMTP\nare supported\n\n\nRequirement\n-----------\n\n* Nodejs \u003e= 6.0\n\n\nUsage Example\n-------------\n\nWrite your crontab file as:\n\n    */10 * * * * * echo CRONJOB.mbp `date`\n\nAnd start cron in foreground with that crontab file:\n\n    $ CRON_JS_MAILTO=user@example.com cron ./crontab\n\n\n`cron` sends all job outputs to stdout, and also send them to\n`user@example.com`.\n\n    $ CRON_JS_MAILTO=user@example.com cron ./crontab\n    [2017-06-15 10:53:09.407] [INFO] [default] - Setting up email notification\n    [2017-06-15 10:53:09.411] [INFO] [default] - Sender: admin@example.com\n    [2017-06-15 10:53:09.411] [INFO] [default] - Mailto: user@example.com\n    [2017-06-15 10:53:09.411] [INFO] [default] - Use sendmail to send emails\n    [2017-06-15 10:53:09.432] [INFO] [default] - Job registered: {\"cronTime\":\"*/10 * * * * *\",\"command\":\"echo CRONJOB.mbp `date`\"}\n    [2017-06-15 10:53:10.441] [INFO] [default] - echo CRONJOB.mbp `date` (pid=67086) | Started.\n    [2017-06-15 10:53:10.449] [INFO] [default] - echo CRONJOB.mbp `date` (pid=67086) | Stdout: CRONJOB.mbp Thu Jun 15 10:53:10 JST 2017\n    [2017-06-15 10:53:10.449] [INFO] [default] - echo CRONJOB.mbp `date` (pid=67086) | Stderr: \n    [2017-06-15 10:53:10.449] [INFO] [default] - echo CRONJOB.mbp `date` (pid=67086) | Exited with code 0\n    [2017-06-15 10:53:10.449] [DEBUG] [default] - echo CRONJOB.mbp `date` (pid=67086) | Sending email to user@example.com\n    [2017-06-15 10:53:20.439] [INFO] [default] - echo CRONJOB.mbp `date` (pid=67139) | Started.\n    [2017-06-15 10:53:20.448] [INFO] [default] - echo CRONJOB.mbp `date` (pid=67139) | Stdout: CRONJOB.mbp Thu Jun 15 10:53:20 JST 2017\n    [2017-06-15 10:53:20.448] [INFO] [default] - echo CRONJOB.mbp `date` (pid=67139) | Stderr: \n    [2017-06-15 10:53:20.448] [INFO] [default] - echo CRONJOB.mbp `date` (pid=67139) | Exited with code 0\n    [2017-06-15 10:53:20.449] [DEBUG] [default] - echo CRONJOB.mbp `date` (pid=67139) | Sending email to user@example.com\n    ...\n\n\n\nArguments\n---------\n\n### Command Usage\n\n    $ [\u003cEMAIL_OPTIONS= \u003e ...] cron [--exit-on-failure] [--timezone \u003ctimeZone\u003e] [\u003cemail options\u003e ...] \u003ccrontab\u003e\n\n| Arguments | Required  | Description |\n| --------- | --------- | ----------- |\n| `\u003ccrontab\u003e` | Yes | crontab file that defines jobs to schedule, one per line\n| `--exit-on-failure` | No | When given and any of jobs ends with status code other than 0, exit cron program with that status code |\n| `--timezone \u003ctimeZone\u003e` | No | When given, set timezone for cron job definitions |\n| `--mailto \u003caddress\u003e`, `--smtp-host \u003chost\u003e`, `--smtp-port \u003cport\u003e`, `--smtp-user \u003cuser\u003e`, `--smtp-pass \u003cpassword\u003e` | No | Email notifiction options: see below for details |\n\n\n\n\n### Crontab Format\n\nA sample crontab file will look like:\n\n    # sec min hour day month day-of-week command\n    # Runs every weekday (Monday through Friday) at 11:30:00 AM\n    00 30 11 * * 1-5 echo foo\n    # Runs 23 minutes 10 seconds after midn, 2am, 4am ..., everyday\n    10 23 0-23/2 * * * echo bar 1\u003e\u00262\n\nWhere each number represents seconds, munites, hours, day of month, \nmonths and day of week respectively.\nAll trailing texts are treated as shell command to execute.\n\nLines that start with `#` are treated as comments and are ignored.\n\nJobs are scheduled with [node-cron](https://www.npmjs.com/package/cron),\nso see its document for details about available cron time format.\n\nSpecifying environment variables in crontab file is not supported.\n\n\n\n### Email Options\n\nFollowing email options are supported.\n\nEmail options can be also passed via environment vairbles.\nWhen both are provided, values given in commandline argument always\ntake precedence.\n\n| Arguments | Environment Variable | Description |\n| --------- | -------------------- | ----------- |\n| `--mailto \u003caddress\u003e` | `CRON_JS_MAILTO` | Email address to send result to\n| `--smtp-host \u003chost\u003e` | `CRON_JS_SMTP_HOST` | SMTP host to use to send emails\n| `--smtp-port \u003cport\u003e` | `CRON_JS_SMTP_PORT` | SMTP port to use to send emails\n| `--smtp-user \u003cuser\u003e` | `CRON_JS_SMTP_USER` | SMTP username to use to send emails\n| `--smtp-pass \u003cpassword\u003e` | `CRON_JS_SMTP_PASS` | SMTP password to use to send emails\n\n\nThere are two email \"mode\" for `cron`:\n\n- When only `--mailto` (or `CRON_JS_MAILTO`) is given of these email options,\n `cron` works in \"sendmail\" mode.\nIn this mode, `cron` tries to send emails via locally installed `sendmail`\ncommand.\n\n- If any of SMTP options are given, `cron` works in \"SMTP\" mode,\nwhere `cron` tries to send emails using provided STMP configurations.\n\n\n\nLicense\n-------\n\nCopyright (c) 2017 10sr \u003c8.slashes@gmail.com\u003e\n\nThis software is licensed under the Apache License, Version 2.0 ,\nsee `LICENSE` for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F10sr%2Fcron-cli-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F10sr%2Fcron-cli-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F10sr%2Fcron-cli-js/lists"}