Git Product home page Git Product logo

keeper's Introduction

keeper

一个简易的定时任务处理程序

介绍

  • 无需重启服务,修改配置文件即刻生效
  • 可指定命令参数运行的shell
  • 灵活配置多任务(一个定时任务多个任务,可配置多个定时任务)

配置文件

[
  {
    "cron": "10 * * * *",
    "name": "测试周期执行1",
    "commands": [
      "ls -al",
      "echo hello"
    ],
    "dir": "/home/luomujian/ireader",
    "specific_shell": true,
    "shell": ""
  },
  {
    "cron": "20 * * * *",
    "name": "测试周期执行2",
    "commands": [
      "ls -al"
    ]
  }
]

配置文件说明

字段 说明
cron 定时任务的cron表达式,参考crontab
name 定时任务的名称
commands 定时任务执行的命令
dir 定时任务执行的目录
specific_shell 是否使用指定的shell运行命令
shell 指定的shell运行命令 ,可选不指定,则不基于shell执行

使用

keeper --help
# 默认使用./keeper.json作为配置文件
keeper
# 指定引用的配置文件
keeper --load other_keeper.json
# 指定shell运行命令
keeper --shell /bin/bash --load other_keeper.json

帮助文档

A simple tool like crontab

Usage:
  keeper [flags]
  keeper [command]

Available Commands:
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command
  version     打印当前版本号

Flags:
  -h, --help           help for keeper
  -l, --load string    config file (default "keeper.json")
  -s, --shell string   running with specific shell (default "bash")

Use "keeper [command] --help" for more information about a command.

keeper's People

Contributors

ns-cn 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.