项目作者: liujianping

项目描述 :
JOB, make your short-term command as a long-term job. 将命令行规划成任务的工具
高级语言: Go
项目地址: git://github.com/liujianping/job.git


job

GoDoc Go Report Card Build Status Version Coverage Status

make your short-term command as a long-term job

Install

Shell Install (Linux & MacOS)

  1. # binary will be $(go env GOPATH)/bin/job
  2. $: curl -sfL https://raw.githubusercontent.com/liujianping/job/master/install.sh | sh -s -- -b $(go env GOPATH)/bin
  3. # In alpine linux (as it does not come with curl by default)
  4. $: wget -O - -q https://raw.githubusercontent.com/liujianping/job/master/install.sh | sh -s

Brew install

  1. $: brew tap liujianping/tap && brew install job

OR

  1. $: git clone https://github.com/liujianping/job.git
  2. $: cd job
  3. $: go build -mod vendor

Usage

  1. $: job -h
  2. Job, make your short-term command as a long-term job
  3. Usage:
  4. job [flags] [command args ...]
  5. Examples:
  6. (simple) $: job echo hello
  7. (schedule) $: job -s "* * * * *" -- echo hello
  8. (retry) $: job -r 3 -- echox hello
  9. (repeat) $: job -n 10 -i 100ms -- echo hello
  10. (concurrent) $: job -c 10 -n 10 -- echo hello
  11. (timeout cmd) $: job -t 500ms -- sleep 1
  12. (timeout job) $: job -T 3s -r 4 -- sleep 1
  13. Flags:
  14. -t, --cmd-timeout duration job command timeout duration
  15. -c, --concurrent int job concurrent numbers
  16. -h, --help help for job
  17. -T, --job-timeout duration job timeout duration
  18. -i, --repeat-interval duration job repeat interval duration
  19. -n, --repeat-times int job repeat times, 0 means forever (default 1)
  20. -r, --retry int job command retry times when failed
  21. -s, --schedule string job schedule in crontab format
  22. --version version for job