{"id":13683456,"url":"https://github.com/Freaky/run-one","last_synced_at":"2025-04-30T13:30:47.287Z","repository":{"id":142942559,"uuid":"92453989","full_name":"Freaky/run-one","owner":"Freaky","description":"A BSD-compatible reimplementation of Ubuntu's run-one","archived":false,"fork":false,"pushed_at":"2023-07-27T16:42:15.000Z","size":22,"stargazers_count":14,"open_issues_count":1,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-23T16:43:22.775Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","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/Freaky.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}},"created_at":"2017-05-25T23:53:49.000Z","updated_at":"2025-02-05T10:53:10.000Z","dependencies_parsed_at":"2024-01-14T16:09:52.039Z","dependency_job_id":"e1d1ee9d-21d9-4ba8-8eb5-b92460015023","html_url":"https://github.com/Freaky/run-one","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/Freaky%2Frun-one","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freaky%2Frun-one/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freaky%2Frun-one/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Freaky%2Frun-one/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Freaky","download_url":"https://codeload.github.com/Freaky/run-one/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251712835,"owners_count":21631447,"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-08-02T13:02:11.988Z","updated_at":"2025-04-30T13:30:46.495Z","avatar_url":"https://github.com/Freaky.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"# run-one\n\nThis is a third-party reimplementation of Dustin Kirkland's [`run-one`][1]\nutility, with various bugfixes, better portability, and some semantic differences.\n\n\n## Requirements\n\nA working `/bin/sh`, `flock` or `lockf`, `sha256` or `sha256sum`, and `pgrep`/`pkill`.\n\nTested on FreeBSD 11 and Debian jessie.\n\n\n## Installation\n\n/usr/local is the default PREFIX, provided to illustrate:\n\n    % make \u0026\u0026 sudo make install PREFIX=/usr/local\n\nLinux users will want to use `bmake`, as punishment for all the times BSD users\nhad to use `gmake`.\n\nThere is a deinstall target.\n\n\n## Usage\n\nrun-one will exit with EX_TEMPFAIL if another instance of the given command is\nrunning:\n\n    % run-one sleep 60 \u0026\n    [1] 3544\n    % run-one sleep 60\n    zsh: exit 75    run-one sleep 60\n\nrun-this-one will kill the running command first:\n\n    % run-one sleep 60 \u0026\n    [1] 16658\n    % run-this-one sleep 60\n    [1]  + exit 70    run-one sleep 60\n\nrun-one-constantly will run in a loop until interrupted, sleeping a second between\nsuccessful runs, and doubling it up to a limit of 60 seconds between unsuccessful:\n\n    % run-one-constantly echo moo\n    moo\n    moo\n    moo\n\nrun-one-until-success does the same, but exits the first time it succeeds.  Both\ncommands log failures, so be mindful of your sysadmin:\n\n    % run-one-until-success false \u0026\n    [1] 92276\n    % tail -f /var/log/messages |grep run-one\n    .. run-one-until-success[92276]: last run failed (rc=1); sleeping 2 seconds\n    .. run-one-until-success[92276]: last run failed (rc=1); sleeping 4 seconds\n    .. run-one-until-success[92276]: last run failed (rc=1); sleeping 8 seconds\n\nrun-one-until-failure does the opposite, and will never log failures.\n\n    % run-one-until-failure false\n    zsh: exit 1     run-one-until-failure false\n\nCommands can of course be mixed:\n\n    % run-one-constantly true \u0026\n    [1] 85332\n    % run-one true\n    zsh: exit 75    run-one true\n    % run-this-one true\n    [1]  + exit 70    run-one-constantly true\n\n\n## Notable differences with the [original run-one][1]\n\n * Runs on FreeBSD (and hopefully others).\n * `keep-one-running` is not provided.\n * `run-one-constantly` and `run-one-until-*` lock the supervision loop, rather\n   than the command itself, so are safer to use in cronjobs etc.\n * Arguments are hashed more carefully, so `run-one frob \"foo bar\"` and\n   `run-one frob foo bar` are correctly treated as distinct commands.\n * run-this-one only considers other instances of flock/lockf, instead of treating\n   the argument list as a pattern to pass to pkill.\n * run-this-one only attempts to kill the children under lockf, not lockf itself,\n   to allow them to exit cleanly.\n * run-this-one will time out after 60s if the children of the existing command\n   refuse to die.\n * Uses $XDG_CACHE_HOME instead of ~/.cache or /dev/shm\n * Is less anal about ownership. If you want to have a group share a lock directory,\n   have at it.\n\n\n## Author\n\nThis version of `run-one` is written by Thomas Hurst.  Do not confuse it with\nthe original.\n\n\n[1]: https://launchpad.net/run-one\n[2]: https://github.com/dustinkirkland/run-one\n[3]: http://blog.dustinkirkland.com/2011/02/introducing-run-one-and-run-this-one.html\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFreaky%2Frun-one","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FFreaky%2Frun-one","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FFreaky%2Frun-one/lists"}