Coder Social home page Coder Social logo

go-cron-simple's Introduction

introduce

go单文件尝试版本的类crontab的支持秒级的调度器

代码没有做深度的结构化思考,只未实现功能尝试,大家可以参考思路

install

$ git clone https://github.com/qklandy/go-cron-simple

# ./build.sh 目录 main文件 输出的bin文件名 GOOS GOARCH
# 编译linux下的64位的bin文件
$ ./build.sh . main goCrondSimple linux amd64

Usage

crontab

@:crontab时间格式和执行命令的分隔符

demo

* * * * * * @ php artisan c:cmd:hotfix
* * * * * * @ php artisan list
预留一行

explain

*    *    *    *    *    *
-    -    -    -    -    -
|    |    |    |    |    |
|    |    |    |    |    +----- 星期中星期几 (0 - 7) (星期天 为0)
|    |    |    |    +---------- 月份 (1 - 12) 
|    |    |    +--------------- 一个月中的第几天 (1 - 31)
|    |    +-------------------- 小时 (0 - 23)
|    +------------------------- 分钟 (0 - 59)
+------------------------------ 秒   (0 - 59)

fire

# simple execute
$ ./goCrondSimple -s=./config/crontab -dd=./ -vvv=true

# background execute
$ nohup ./goCrondSimple -s=./config/crontab -dd=./ -vvv=true >> /dev/null 2>&1 &

# systemd
hold on...

Extended

GOOS:目标可执行程序运行操作系统
darwin: macos
freebsd: bsd
linux: linux
windows: window系统

GOARCH:目标可执行程序操作系统构架
386:32位
amd64:64位
arm:arm

go-cron-simple's People

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.