{"id":13694488,"url":"https://github.com/george518/PPGo_Job","last_synced_at":"2025-05-03T04:30:32.129Z","repository":{"id":44454140,"uuid":"95182917","full_name":"george518/PPGo_Job","owner":"george518","description":"PPGo_Job是一款可视化的、多人多权限的、一任务多机执行的定时任务管理系统，采用golang开发，安装方便，资源消耗少，支持大并发，可同时管理多台服务器上的定时任务。","archived":false,"fork":false,"pushed_at":"2024-05-22T09:41:21.000Z","size":27537,"stargazers_count":1513,"open_issues_count":50,"forks_count":396,"subscribers_count":56,"default_branch":"master","last_synced_at":"2025-04-07T18:11:10.605Z","etag":null,"topics":["cron","crontab","golang","job-scheduler","remote-control","task"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/george518.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-23T04:25:05.000Z","updated_at":"2025-03-25T03:20:57.000Z","dependencies_parsed_at":"2024-04-19T10:46:54.641Z","dependency_job_id":"b92ab2a9-f63f-4089-9c01-6f500150fbf8","html_url":"https://github.com/george518/PPGo_Job","commit_stats":{"total_commits":157,"total_committers":7,"mean_commits":"22.428571428571427","dds":0.6242038216560509,"last_synced_commit":"89a79256b1ae8b56a316d86388dcd88be0c8b349"},"previous_names":[],"tags_count":10,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/george518%2FPPGo_Job","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/george518%2FPPGo_Job/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/george518%2FPPGo_Job/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/george518%2FPPGo_Job/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/george518","download_url":"https://codeload.github.com/george518/PPGo_Job/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252144259,"owners_count":21701376,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cron","crontab","golang","job-scheduler","remote-control","task"],"created_at":"2024-08-02T17:01:33.423Z","updated_at":"2025-05-03T04:30:27.878Z","avatar_url":"https://github.com/george518.png","language":"Go","funding_links":[],"categories":["Misc","开源类库","Open source library"],"sub_categories":["任务/定时器","Task/Timer"],"readme":"PPGo_Job定时任务管理系统\n====\n\n![](http://www.haodaquan.com/Uploads/article/2018-07-26/153262059813931.png)\n\n一、说明\n----\nPPGo_Job是一款轻量级定时任务管理系统，go语言开发，部署超级简单，资源消耗少，运行稳定。\n支持定时任务可视化管理、多人多权限的管理，支持大并发，可同时管理多台服务器上的定时任务。\n\nPPGo_Job从v1.0开源以来，得到众多技术朋友的支持和欢迎，已应用在多个公司的生产环境，同时也\n吸收使用者的建议和意见，不断改进和优化，目前已经上线了20余个版本，9个稳定版本（生产环境部署完成后才发布新版本）。\n\n\n码云地址：https://gitee.com/georgehao/PPGo_Job\nGithub地址:https://github.com/george518/PPGo_Job\n\n文档地址：http://www.haodaquan.com/topics/1###\nWiki:https://github.com/george518/PPGo_Job/wiki\n\n\n二、架构 \n----\n![](http://www.haodaquan.com/Uploads/editormd/2019-07-06/156240332990478.png)\n\n\n![](http://www.haodaquan.com/Uploads/editormd/2019-07-21/156368574611565.png)\n三、特性\n----\n\n\nV2.x新增以下功能和特性：\n\n- 1、全新UI,基于LayUI构建全新页面，后端模板手工搭建，让操作更加人性化。后台模板地址：https://github.com/george518/PP_admin-template\n- 2、新增权限管理功能，根据菜单权限、操作权限和数据权限进行划分，方便多用户多权限管理定时任务。\n- 3、新增服务器复制功能，让服务器资源添加更加方便。\n- 4、新增定时任务详情页面，将任务相关操作更加集中起来操作。\n- 5、新增任务审核功能，提高任务的管控能力。\n- 6、新增禁止命令管理功能，配合任务审核功能，提高任务运行安全性，总有人会犯错。\n- 7、优化日志详情页面，查看日志更方便，你想看到的现场内容都在，亲。\n- 8、支持docker化部署，这年头，系统不支持docker化部署好像不能出门似的。\n- 9、支持windows系统运行定时系统，不歧视windows，也要支持。\n- 10、提醒信息新增钉钉和微信通知功能，并支持编辑通知模版功能。让提醒内容个性化，不再死板。\n- 11、新增创建、启动、关闭任务的API，通过接口的方式控制定时任务，猜你喜欢。\n- 12、**新增任务执行器agent，可以通过ssh，telnet或者agent的方式接受并执行任务**\n\n总之，管理定时任务，使用PPGo_Job吧，节省出来的时间，或皮或浪，随你。\n\n\n\n三、支持\n----\n1、给项目一个star\n\n2、请我喝瓶水\n\n![github](https://github.com/george518/PP_blog/blob/master/static/public/images/weixin.png?raw=true \"github\")\n\n四、先睹为快\n----\n![image](https://github.com/linxiaozhi/PPGo_Job/blob/master/assets/screenshot/1-index.png?raw=true \"github\")\n![image](https://github.com/linxiaozhi/PPGo_Job/blob/master/assets/screenshot/2-task.png?raw=true \"github\")\n![image](https://github.com/linxiaozhi/PPGo_Job/blob/master/assets/screenshot/3-task_detail.png?raw=true \"github\")\n![image](https://github.com/linxiaozhi/PPGo_Job/blob/master/assets/screenshot/10-auth.png?raw=true \"github\")\n![image](https://github.com/linxiaozhi/PPGo_Job/blob/master/assets/screenshot/11-role.png?raw=true \"github\")\n![image](https://github.com/linxiaozhi/PPGo_Job/blob/master/assets/screenshot/12-role_add.png?raw=true \"github\")\n![image](https://github.com/linxiaozhi/PPGo_Job/blob/master/assets/screenshot/15.log.png?raw=true \"github\")\n\n\n五、安装方法\n----\n\n方法一、 编译安装\n\n- go get github.com/george518/PPGo_Job\n- 创建mysql数据库，并将ppgo_job2.sql导入\n- 修改config 配置数据库\n- 运行 go build\n- 运行 ./run.sh start|stop\n\nmac\n- 运行 ./package.sh -a amd64 -p darwin -v v2.x.0\n\nlinux\n- 运行 ./package.sh -a 386 -p linux -v v2.x.0\n- 运行 ./package.sh -a amd64 -p linux -v v2.x.0\n\nwindows\n- 运行 ./package.sh -a amd64 -p windows -v v2.x.0\n\n\n方法二、直接使用\n\nlinux\n\n- 进入 https://github.com/george518/PPGo_Job/releases\n- 下载 ppgo_job-linux-2.x.0.zip 并解压\n- 进入文件夹，设置好数据库(创建数据库，导入ppgo_job2.sql)和配置文件(conf/app.conf)\n- 运行 ./run.sh start|stop\n\nmac\n\n- 进入https://github.com/george518/PPGo_Job/releases\n- 下载 ppgo_job-mac-2.x.0.zip 并解压\n- 进入文件夹，设置好数据库(创建数据库，导入ppgo_job2.sql)和配置文件(conf/app.conf)\n- 运行 ./run.sh start|stop\n\nwindows\n\n- 进入 https://github.com/george518/PPGo_Job/releases\n- 下载 ppgo_job-windows-2.x.0.zip 并解压\n- 进入文件夹，设置好数据库(创建数据库，导入ppgo_job2.sql)和配置文件(conf/app.conf)\n- 运行 run.bat\n\n----\n前台访问：http://your_host:8080\n用户名：admin 密码：123456\n\n配置文件\n----\n根据自己的情况修改数据库和启动端口\n```\nappname = PPGo_Job2\nhttpport = 8080\nrunmode = dev\n\nversion= V2.2\n\n# 允许同时运行的任务数\njobs.pool = 1000\n\n# 站点名称\nsite.name = 定时任务管理器\n\n#通知方式 0=邮件，1=信息，2=钉钉，3=微信\nnotify.type = 0\n\n# 数据库配置\ndb.host = 127.0.0.1\ndb.user = root\ndb.password = \"123456\"\ndb.port = 3306\ndb.name = ppgo_job2\ndb.prefix = pp_\ndb.timezone = Asia/Shanghai\n\n# 邮件通知配置\nemail.host = smtp.mxhichina.com\nemail.port = 25\nemail.from = ci@xxx.cn\nemail.user = ci@xxx.cn\nemail.password = \"xxxxxx\"\nemail.pool = 10\n\n# 短信通知方式配置\nmsg.url = http://chanxiyou.com/api/tools/send_sms\nmsg.pool = 10\n\n# 钉钉通知配置\ndingtalk.url = \"https://oapi.dingtalk.com/robot/send?access_token=%s\"\ndingtalk.pool = 10\n\n# 微信通知方式配置\nwechat.url = http://xx.com/api/tools/send_wechat\nwechat.pool = 10\n```\n\n六、编译安装-可能会遇到的问题\n----\ngo build 时遇到以下错误：\njobs/job.go:19:2: cannot find package \"golang.org/x/crypto/ssh\" in any of:\n\n需要 git clone https://github.com/golang/crypto.git\n并拷贝到 $GOPATH/src/golang.org/x/ 下就OK\n\n或\n\ngit clone https://github.com/golang/crypto.git $GOPATH/src/golang.org/x/crypto\n\n# Docker\n本地编译好的2进制文件放在根目录下执行下面的命令即可拥有\n```bash\nCGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build\n```\n\n```\ndocker-compose up -d\n\n#日志查看\ndocker-compose logs -f web\n\n```\n# Windows远程执行\n\n1.开启telnet功能\n\n控制面板-\u003e程序和功能-\u003e打开或关闭Windows功能，选择Telnet服务端和Telnet客户端\n\n2.启动telnet服务\n\n控制面板-\u003e管理工具-\u003e服务-\u003eTelnet-\u003e启动类型改为自动并启动\n\n3.登陆授权\n\n控制面板-\u003e管理工具-\u003e本地安全策略，在本地安全策略中，安全设置-\u003e本地策略-\u003e安全选项-\u003e网络访问:本地帐户的共享和安全模型-\u003e经典\n\n控制面板-\u003e管理工具-\u003e本地安全策略-\u003e安全设置-\u003e本地策略-\u003e安全选项-\u003e帐户:使用空密码的本地帐户只允许进行控制台登录-\u003e已禁用\n\n控制面板-\u003e管理工具-\u003e计算机管理-\u003e系统工具-\u003e本地用户和组-\u003e组-\u003eTelnetClients-\u003e添加用户\n\n七、任务接口说明\n----\n三个简陋的接口，满足日常所需。\n\n1、新增和修改任务接口 \n\n- url：/task/apitask\n- method：post \n- params：\n```\nid:0\ncreate_id:4\ngroup_id:3\ntask_name:测试API创建任务\ndescription:测试\nconcurrent:0\nserver_id:2\ncron_spec:*/2 * * * *\ncommand:free -G\ntimeout:0\nis_notify:0\nnotify_type:0\nnotify_tpl_id:0\nnotify_user_ids:0\n```\n\n参数含义详见数据库字段。\n需要注意的是id为0为新增，大于0为修改。\n\n2、任务启动接口\n \n- url：/task/apistart\n- method：post \n- params：\n\n```\nid:11\n```\n\n3、任务暂停接口\n\n- url：／task/apipause\n- method：post \n- params：\n \n ```\n id:11\n ```\n\n\n注意使用 form-data的方式传参\n\n4、返回json，status=0表示成功，其他为失败，msg是错误理由或id\n\n```\n{\n    \"message\": 11,\n    \"status\": 0\n}\n```\n\n具体可以使用postman测试\n\n\n八、常见操作问题\n----\n1、如何删除任务？\n\n目前操作的步骤是，在非admin用户登陆情况下，编辑一下任务，此任务会到待审核任务列表中，就可以删除了。\n因为删除已经审核通过的任务是敏感操作，并且认为删除任务操作执行不多，再加上列表中操作太多，所以就放到待审核任务里执行操作了。如果大家觉得需要在任务列表中添加的话，后期再做修改。\n\n2、删除资源分组问题。\n\n所谓的资源，其实就是执行任务的服务器或者容器。资源的分组就是给这些服务器或者容器分个类。因此，删除资源分组的时候，基于谨慎型原则，必须保证要删除的资源分组下没有服务器资源。要么删除，要么转移到其他分组下。\n\n\n\n九、联系我\n----\nqq群号:547564773\n欢迎交流，欢迎提交代码。\n\n十、感谢\n----\n@bannerchi \n@linxiaozhi \n@gongwalker\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorge518%2FPPGo_Job","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeorge518%2FPPGo_Job","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeorge518%2FPPGo_Job/lists"}