{"id":23508740,"url":"https://github.com/lovasko/oh","last_synced_at":"2025-05-13T15:34:31.989Z","repository":{"id":78821066,"uuid":"166275942","full_name":"lovasko/oh","owner":"lovasko","description":"Opening Hours","archived":false,"fork":false,"pushed_at":"2019-01-25T02:45:05.000Z","size":7,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-16T19:48:24.004Z","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":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lovasko.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":"2019-01-17T18:32:41.000Z","updated_at":"2019-10-21T09:35:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"3548bcd7-66df-40e2-841d-121e2469f8ec","html_url":"https://github.com/lovasko/oh","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/lovasko%2Foh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovasko%2Foh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovasko%2Foh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovasko%2Foh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lovasko","download_url":"https://codeload.github.com/lovasko/oh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253970393,"owners_count":21992487,"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-12-25T11:31:54.354Z","updated_at":"2025-05-13T15:34:31.914Z","avatar_url":"https://github.com/lovasko.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# oh\nThis program allows for definition of _opening hours_ for a selected process.\n\n## Case study\nLet's suppose that a computationally intensive program `compute_pi` that\naccepts an option to define the number of digits to which it computes the\nmathematical constant _pi_. Such computation is resource-intensive and might be\nbest limited to certain hours during the day. Reasons for such limitation might\nbe twofold: making sure that the system isn't impacted during certain important\nhours (e.g. when other users might be needing the shared computing resources),\nor when the system itself might need time to cool down, so that overheating\nwill not occur.\n\nTo achieve this with `oh`, one would type something along the lines of the\nfollowing example:\n```\n$ oh -w -o 00:15 -c 06:30 -- compute_pi -d 1000000000\n```\n\n## Note on midnight\nThe common use case is for the process to run in the night hours, and thus the\nopening and closing times have to deal with midnight reset of the clock. This\nis handled by the `oh` program - it is therefore possible to select a closing\ntime that appears to be _before_ the opening time. This will result in the\nprocess being allowed to run during the night hours.\n\n## Note on signals\nThe `oh` tool uses UNIX signals to control the monitored process. It is\ntherefore advisable that the process in question does not block the delivery of\n`SIGTSTP` and `SIGCONT` signals. It is of course possible for the process to\noverride the handling of the `SIGTSTP` signal to perform the necessary clean-up\nactions, but the process is itself responsible for the pausing operation.\n\n## Options and flags\nThe `oh` utility accepts the following options and flags to alter its\nexecution:\n\n### `-c HH:MM`\nThe closing time of a process is when its execution is paused. The time format\nexpected is hours, followed by a colon character (`:`), followed by minutes.\nThe hours are limited to an inclusive range of `00` to `23`, whereas the\nminutes are limited to an inclusive range of `00` to `59`. Whitespace\ncharacters on either side of the string are not allowed. In case any of the\nnumbers requires only a single digit (e.g. `6:10`) it is allowed to omit the\nleading zero.\n\n### `-h`\nThe help message describing all options and flags can be displayed by using the\nspecial `-h` flag.\n\n### `-o HH:MM`\nAnalogously to the closing time option, the `-o` option allows for defining the\nopening time of the process, thus resuming its execution. The same time format\nsyntax applies.\n\n### `-s`\nThe POSIX suite of standards specify two main signals that are intended to\npause the execution of a process - `SIGTSTP` and `SIGSTOP`. The latter can't be\nmasked by the process, whilst the former can be handled by the process and\noffers the opportunity of a clean pause (e.g. resetting any TTY settings, or\nflushing buffers). The default choice of `oh` is to issue the softer `SIGTSTP`,\nbut it has been recognised that some instances require the harder `SIGSTOP`.\nThe `-s` flag allows to selected the stricter `SIGSTOP` signal.\n\n### `-w`\nCertain systems experience high loads during working days (or even just during\nworking hours) and are practically idle during the weekends. The `-w` flag is\nto allow unlimited run during the weekends.\n\n## Supported platforms\nThe program is written in strict ISO C99 language, using the POSIX.1 interface\nto the kernel. Feature test macros used are: `_XOPEN_SOURCE`, and\n`_POSIX_C_SOURCE`. All platforms conforming to such standards with the\nappropriate C compiler are strongly expected to function as expected - any\nreports of deviations are welcomed.\n\n## License\nThe `nemo-core` project is licensed under the terms of the [2-cause BSD\nlicense](LICENSE).\n\n## Author\nDaniel Lovasko \u003cdaniel.lovasko@gmail.com\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flovasko%2Foh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flovasko%2Foh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flovasko%2Foh/lists"}