{"id":17284692,"url":"https://github.com/exu/splitter","last_synced_at":"2025-03-26T16:26:04.943Z","repository":{"id":24677718,"uuid":"28088517","full_name":"exu/splitter","owner":"exu","description":"Go lang jobs splitter ","archived":false,"fork":false,"pushed_at":"2014-12-27T21:02:54.000Z","size":2268,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-31T21:07:25.557Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/exu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-16T13:38:01.000Z","updated_at":"2014-12-27T21:02:54.000Z","dependencies_parsed_at":"2022-08-23T07:11:07.107Z","dependency_job_id":null,"html_url":"https://github.com/exu/splitter","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/exu%2Fsplitter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exu%2Fsplitter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exu%2Fsplitter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/exu%2Fsplitter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/exu","download_url":"https://codeload.github.com/exu/splitter/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245691073,"owners_count":20656697,"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-10-15T09:54:43.795Z","updated_at":"2025-03-26T16:26:04.914Z","avatar_url":"https://github.com/exu.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"```\n            _______________\n           \u003c  Job splitter \u003e\n            ---------------\n                   \\   ^__^\n                    \\  (oo)\\_______\n                       (__)\\       )\\/\\\n                           ||----w |\n                           ||     ||\n\n```\n\n\n## Usage:\n\n`splitter [options] \u003crepeater\u003e \u003ccommand\u003e`\n\nor\n\n`splitter [options] \u003cfile name\u003e`\n\nif first parameter is file name command and reapeater are not needed!\n\n### Parameters:\n\n- `\u003creapeter\u003e`  - decide how many jobs to run (numbers passed to command string)\n- `\u003ccommand\u003e`   - command template (could contain %s placeholder,\n                    where number from repeater will be injected\n- `\u003cfile name\u003e` - file with command in each line, if you pass file parameter\n\n\n### Options:\n\n- `--exit` exit on error - default false\n- `--pool` worker pool size - default 4\n           \u003crepeater\u003e and \u003ccommand\u003e is not needed anymore\n\n\nIt splits your work to workers pool if you need run some command several times in parallel.\nYou can pass `\u003creapeter\u003e` parameter which is responsible for jobs count or runned job command.\nLook below for more details.\n\n\n### Repeater parameter\n\nRepeater can be in different forms:\n- `1233` - (int) splitter run 1233 times passed command: `splitter 1233 ls -la`\n\nyou can pass %s parameter to command too.\n\n- `1,2,10,20` - int list `splitter mom,dad,son ls -la %s-directory`\n\nsplitter will run 4 jobs:\n```\nls -la mom-directory\nls -la dad-directory\nls -la son-directory\n\n\n```\n- `1-20` - num range (`splitter 1-20 ls -la directory-%s`)\nspliiter will run 20 jobs:\n```\nls -la directory-1\nls -la directory-2\n...\n...\nls -la directory-19\nls -la directory-20\n```\n\n\n- You can merge above two in number chains:\n- `1-3,6,8,10-12,extra` - num range (`splitter 1-3,6,8,10-12 ls -la directory-%s`)\n```\nls -la directory-1\nls -la directory-2\nls -la directory-3\nls -la directory-6\nls -la directory-8\nls -la directory-10\nls -la directory-11\nls -la directory-12\nls -la directory-extra\n```\n\nFor each of above examples you can pass `%s` parameter to shell command\nsplitter will inject repeater part into it before executing.\n\n\n\n## Installation\n\n```\ngo get github.com/exu/splitter\n```\n\nrun `splitter` without parameters if you need help\n\n\n## Additional informations\n\n- no string ranges (for me unnecessary)\n- remember that shell processed are spwned in goroutines\ntry to run `splitter 199 echo %s \u003e\u003e out.txt` You'll see\nthat number aren't ordered\n- examples are trivial, it'll be better to run some long running tasks :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexu%2Fsplitter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fexu%2Fsplitter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fexu%2Fsplitter/lists"}