GithubHelp home page GithubHelp logo

dao12dao / gcron Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 22.98 MB

gcron, means crontab in golang. 分布式定时任务管理系统,用go语言编写,并提供管理后台

Home Page: https://github.com/dao12dao/gcron

License: MIT License

Go 67.24% HTML 31.68% Dockerfile 0.26% Shell 0.82%
go golang crontab cron cronjob distributed etcd gin mongo scheduled-jobs

gcron's Introduction

Distributed Task Scheduling System(DTS) - 分布式定时任务管理系统

https://img.shields.io/github/stars/dao12dao/gcron?style=social

DTS is written in pure Golang, Used to replace crontab in Linux.

DTS是用Go语言实现的分布式定时任务管理系统,用于代替Linux的Crontab定时任务管理。

Tasks can be executed in more than one node with lock mode.

任务可运行在多个节点,实现了基础的服务发现和任务分布式锁。

Project Structure

  • master:The scheduler for create task, query log and send signal, etc.
  • worker:Task executor.
  • common:Common module of master and worker.

Dependencies

  • etcd
  • mongodb
  • gin

Features

  • Create/Edit Task
  • Delete Task
    • Just Remove Task by TaskName.
  • Kill Task
    • Interrupt the running task.
  • View Log
    • List the task log.

Deployment

  • Generate swagger docs for api in master.(Optional)
    • bash> swag init --dir ./ -g master/main/master.go -o master/docs
  • Build master and run, also can run with nginx.
    • bash> go build (-tags doc) -o master/main/master master/main/master.go
    • bash> cd master/main && ./master -config config.ini
  • Build worker and run.
    • bash> go build -o worker/main/worker worker/main/worker.go
    • bash> cd worker/main && ./worker -config config.ini
  • Visit the backend web page.
    • http://localhost:8080/web
  • Visit the api docs page.
    • http://localhost:8080/docs or http://localhost:8080/swagger/index.html

Systemctl(Linux)/Launchctl(MacOS)

Run at system loaded with systemctl in linux or with launchctl in macos.

  • create config file.
    • Linux: copy any service file in the path /etc/systemd, then rename the file and modify the fields like DescriptionExecStartWorkingDirectory.
    • MacOS: copy any plist file in the path ~/Library/LaunchAgents/, then rename the file and modify the fields like LabelProgramArgumentsWorkingDirectory.
  • enable the file.
    • Linux: bash> systemctl enable xx.service
    • MacOS: bash> launchctl load -w xxx.plist
  • start to run.
    • Linux: bash> systemctl start xx.service

gcron's People

Contributors

dao12dao avatar dependabot[bot] avatar

Stargazers

 avatar

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.