项目作者: yuis-ice

项目描述 :
Command Line Implementation for Node Cron Under 20 Lines.
高级语言: JavaScript
项目地址: git://github.com/yuis-ice/node-cron-cli.git
创建时间: 2021-01-17T15:58:08Z
项目社区:https://github.com/yuis-ice/node-cron-cli

开源协议:BSD 3-Clause "New" or "Revised" License

下载


Node Cron CLI

Command Line Implementation for Node Cron Under 20 Lines.

Quick Start

This will execute your specified command pwd each 2 seconds.

  1. $ croncli -p "*/2 * * * * *" -e "pwd" --log

The output be like:

  1. Jobs started...
  2. [*/2 * * * * *] Job fired: 05/12/2021, 08:42:28 PM GMT+9
  3. /home/ubuntu
  4. [*/2 * * * * *] Job fired: 05/12/2021, 08:42:30 PM GMT+9
  5. /home/ubuntu
  6. [*/2 * * * * *] Job fired: 05/12/2021, 08:42:32 PM GMT+9
  7. /home/ubuntu

Installation

  1. npm i --global node-cron-cli

Examples

Every hour

  1. 0 0 * * * *

Every day

  1. 0 0 0 * * *

Every 4 hours

  1. 0 0 */4 * * *

Every day at 11am and 11pm

  1. 0 0 11,23 * * *

For more info, see kelektiv/node-cron

Command line options

  1. $ ./cron-cli.js
  2. Usage: cron-cli [options]
  3. Options:
  4. -p, --pattern <pattern> cron pattern (default: "*/5 * * * * *")
  5. -t, --timezone <timezone> timezone (default: "Asia/Tokyo")
  6. -e, --execute <command> command to be executed (default: "echo Hi.")
  7. -l, --log enable console log
  8. -h, --help display help for command

LICENSE

This software is released under the BSD-3-Clause license.