2017-03-23 05:58:42 +00:00
|
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
/*--------------------------------------------------------
|
2017-04-02 02:38:49 +00:00
|
|
|
|
定时任务调度
|
2017-03-23 05:58:42 +00:00
|
|
|
|
兼容Linux crontab时间格式语法,最小粒度可精确到每秒
|
2017-03-24 09:55:44 +00:00
|
|
|
|
支持通过HTTP、SSH协议任务执行
|
2017-03-23 05:58:42 +00:00
|
|
|
|
--------------------------------------------------------*/
|
|
|
|
|
|
|
|
|
|
import (
|
2017-04-02 02:34:47 +00:00
|
|
|
|
"github.com/urfave/cli"
|
|
|
|
|
"os"
|
2017-03-23 05:58:42 +00:00
|
|
|
|
|
2017-04-02 02:34:47 +00:00
|
|
|
|
"github.com/ouqiang/cron-scheduler/cmd"
|
2017-03-23 05:58:42 +00:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
const AppVersion = "0.0.1"
|
|
|
|
|
|
|
|
|
|
func main() {
|
2017-04-02 02:34:47 +00:00
|
|
|
|
app := cli.NewApp()
|
|
|
|
|
app.Name = "cron-scheduler"
|
|
|
|
|
app.Usage = "cron-scheduler service"
|
|
|
|
|
app.Version = AppVersion
|
|
|
|
|
app.Commands = []cli.Command{
|
|
|
|
|
cmd.CmdWeb,
|
|
|
|
|
}
|
|
|
|
|
app.Flags = append(app.Flags, []cli.Flag{}...)
|
|
|
|
|
app.Run(os.Args)
|
2017-03-23 05:58:42 +00:00
|
|
|
|
}
|