{"id":18549049,"url":"https://github.com/typoverflow/schedule","last_synced_at":"2025-05-15T09:10:21.582Z","repository":{"id":122589205,"uuid":"235786212","full_name":"typoverflow/schedule","owner":"typoverflow","description":"A command-line tool for task arrangement","archived":false,"fork":false,"pushed_at":"2020-02-16T14:47:44.000Z","size":13,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-02-17T10:14:22.985Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/typoverflow.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":"2020-01-23T12:02:59.000Z","updated_at":"2020-02-16T14:47:46.000Z","dependencies_parsed_at":"2024-07-29T08:06:25.163Z","dependency_job_id":null,"html_url":"https://github.com/typoverflow/schedule","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typoverflow%2Fschedule","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typoverflow%2Fschedule/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typoverflow%2Fschedule/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/typoverflow%2Fschedule/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/typoverflow","download_url":"https://codeload.github.com/typoverflow/schedule/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254310517,"owners_count":22049470,"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":[],"created_at":"2024-11-06T20:37:51.852Z","updated_at":"2025-05-15T09:10:21.551Z","avatar_url":"https://github.com/typoverflow.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Schedule  ![](https://img.shields.io/badge/license-MIT-blue) ![](https://img.shields.io/badge/PRs-welcome-green) ![](https://img.shields.io/badge/issues-welcome-green)\n\n+ A simple, easy-to-use command-line tool for task management.\n\n## Folder structure\n```c\n.\n├── LICENSE\n├── README.md\n├── schedule.c     // source code\n├── schedule.h    // types and includes\n└── utils.c       // some functions for testing here\n```\n\n## Install\n1. clone this repo.\n```bash\ngit clone https://github.com/Derek-Gcx/schedule.git\n```\n2. compile.\n```bash\ncd schedule \u0026\u0026 mkdir build\ngcc schedule.c -o ./build/schedule\n```\n3. move\n```bash\nsudo mv ./build/schedule /bin/\n```\n4. now you can use schedule as a command-line tool !\n```bash\nschedule run \"echo \"hello world!\"\"\n```\n\n## What can ```schedule``` do?\n#### run\n+ arrange a task and execute it either forestage or backstage.\n+ **options**\n  + ```-n/--name \u003cname\u003e```: Specify the task name, default to ```run```\n  + ```-d/--dest \u003cfile\u003e```: Redirect the output to file specified by ```\u003cfile\u003e```\n  + ```-u/--user \u003cname\u003e```: Specify the user, default to the current user\n  + ```-L/--latency \u003cint\u003e```: Postpone the execution for ```\u003cint\u003e``` seconds\n  + ```-b/--back```: Execute the programs backstage. When the option ```-b/--back``` is given, option ```-d/--dest``` must be specified as well.\n\n+ **example**\n```bash\nschedule run ./exe1 ./exe2 ./exe3 -b -d /tmp/res.txt -n my_workflow\n```\n\n#### all\n+ display all the running tasks and their names and pids.\n+ **options**\n  + no options.\n+ **example**\n```bash\nschedule all\n```\n\n#### terminate\n+ terminate a task which you started before.\n+ **You have to specify the name of the task you'd like to terminate. If you're not sure about the name, you can run ```schedule all``` to get it.**\n+ **example**\n```bash\nschedule all\nschedule terminate -n some_task\n```\n\n## 遗留问题、bug\n+ 在运行```schedule run exe1```时，如果使用```ctrl+c```，尽管该进程已被中断，该进程的信息仍然会遗留在```/tmp/schedule_pool```文件中。\n+ 异常处理部分较混乱，在execute中子进程部分未进行异常判断，缺失非法操作的捕捉和处理程序。\n+ 使用逻辑和主流命令行工具相比有所出入。我最近也在阅读一些命令行工具的源码，有时间尽量重构。\n+ --help选项展现的帮助信息不完整。\n+ 在后台运行功能中，多进程的编写方式和输入输出重定向比较幼稚。目前采用的是fork+exec+dop2实现子进程调用外部命令并重定向的功能，或许有其他实现方式，比如通过popen建立管道并获取管道进程pid。需要进一步拓展知识。\n+ 可以考虑加入更多的功能和选项，比如超时自动终止进程。\n\n## 废话\n+ 之前给神经网络调参并进行迭代对弈的时候发现每次都要在命令行运行一系列程序很烦，再加上最近武汉肺炎闲得无聊，就写了一个任务管理的命令行小工具。\n+ 由于自己的水平实在有限，请一定要**谨慎**使用。","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftypoverflow%2Fschedule","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftypoverflow%2Fschedule","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftypoverflow%2Fschedule/lists"}