{"id":13700939,"url":"https://github.com/qvl/sleepto","last_synced_at":"2025-05-04T19:33:53.875Z","repository":{"id":65416633,"uuid":"75099867","full_name":"qvl/sleepto","owner":"qvl","description":"An alternative to traditional task schedulers","archived":true,"fork":false,"pushed_at":"2017-12-06T15:18:29.000Z","size":46,"stargazers_count":96,"open_issues_count":0,"forks_count":2,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-01-22T00:43:11.058Z","etag":null,"topics":["cron","golang","job-scheduler","schedule","sleep-timer","systemd","task-scheduler"],"latest_commit_sha":null,"homepage":"https://qvl.io/sleepto","language":"Go","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/qvl.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}},"created_at":"2016-11-29T16:24:33.000Z","updated_at":"2024-08-17T13:49:54.000Z","dependencies_parsed_at":"2023-01-22T14:05:11.590Z","dependency_job_id":null,"html_url":"https://github.com/qvl/sleepto","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qvl%2Fsleepto","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qvl%2Fsleepto/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qvl%2Fsleepto/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qvl%2Fsleepto/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qvl","download_url":"https://codeload.github.com/qvl/sleepto/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252389654,"owners_count":21740187,"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","golang","job-scheduler","schedule","sleep-timer","systemd","task-scheduler"],"created_at":"2024-08-02T20:01:09.862Z","updated_at":"2025-05-04T19:33:53.574Z","avatar_url":"https://github.com/qvl.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"#  :zzz: sleepto\n\n[![GoDoc](https://godoc.org/qvl.io/sleepto?status.svg)](https://godoc.org/qvl.io/sleepto)\n[![Build Status](https://travis-ci.org/qvl/sleepto.svg?branch=master)](https://travis-ci.org/qvl/sleepto)\n[![Go Report Card](https://goreportcard.com/badge/qvl.io/sleepto)](https://goreportcard.com/report/qvl.io/sleepto)\n\n\n`sleepto` is a simple alternative to task schedulers like [Cron](https://en.wikipedia.org/wiki/Cron).\n\nIt only handles the timing and doesn't run a daemon like other schedulers do.\nInstead we encourage you to use your systems default init system (for example [Systemd](#systemd)) to control your jobs.\nThis allows you to:\n\n- Use and watch scheduled jobs the way you use all other services running on your system (for example using `ps`).\n- Start and pause jobs like any other service on your system.\n- Use your systems default logging system.\n- No conflicts - next task is only scheduled after previous one finished.\n- Trigger immediate execution by sending a `SIGALRM` signal.\n- Specify execution times with the precision of seconds (Cron only supports minutes).\n- Always know the time of the next execution.\n\nThanks to [runwhen](http://code.dogmap.org/runwhen/) for inspiration.\n\n\n    Usage: sleepto [flags...] [command...]\n\n    Sleep until next time the specified conditions match.\n\n    Conditions are specified with flags.\n    All flags are optional and can be used in any combination.\n    The condition flags take one or more value each.\n    Values are separated by comma.\n\n    Note that conditions match not the current, but the next possible match.\n    When the current date is March 2017\n    and you run 'sleepto -month 3' the execution time is March 1, 2018.\n\n    A command can be specified optionally.\n    All arguments following the command are passed to it.\n\n    When the process receives a SIGALRM signal it finishes immediately.\n\n    Examples:\n      # Next 10th of month at 3pm\n      sleepto -day 10 -hour 15 /bin/send-report\n      # Next occurence of one quarter of hour\n      sleepto -minute 0,15,30,45 say \"Hello human\"\n      # Next day at 1am\n      sleepto -hour 1 \u0026\u0026 ~/dbbackup.sh\n\n    Flags:\n      -day value\n            1 to 31\n      -hour value\n            0 to 23\n      -minute value\n            0 to 59\n      -month value\n            1 to 12\n      -second value\n            0 to 59\n      -silent\n            Suppress all output\n      -version\n            Print binary version\n      -weekday value\n            mo,tu,we,th,fr,sa,su\n      -year value\n            list of years\n\n    For more visit: https://qvl.io/sleepto\n\n\n\n## Install\n\n- With [Go](https://golang.org/):\n```\ngo get qvl.io/sleepto\n```\n\n- With [Homebrew](http://brew.sh/):\n```\nbrew install qvl/tap/sleepto\n```\n\n- Download from https://github.com/qvl/sleepto/releases\n\n\n## Setup\n\n`sleepto` can be used in different scenarios but the most common one is probably to combine it with an init system.\n\n### [Systemd](https://en.wikipedia.org/wiki/Systemd)\n\n[Systemd](https://en.wikipedia.org/wiki/Systemd) already runs on most Linux systems.\n\nIt even has its own [timer implementation](https://www.freedesktop.org/software/systemd/man/systemd.timer.html) which can be the right solution for many use cases.\nHowever, if you don't want to depend on the specific features of one init system or you like to reuse the same logic in other scenarios `sleepto` can be the the right tool for that.\n\nSee [ghbackup for an example](https://github.com/qvl/ghbackup#systemd-and-sleepto) on how to use `sleepto` in a service.\n\n- See the logs for your service use:\n```\nsudo journalctl -u servicename\n```\n- List processes which should include your service:\n```\nps fux\n```\n- Immediately finish sleeping:\n```\nsudo systemctl kill -s ALRM servicename\n```\n\n\n## Development\n\nMake sure to use `gofmt` and create a [Pull Request](https://github.com/qvl/sleepto/pulls).\n\n\n### Releasing\n\nPush a new Git tag and [GoReleaser](https://github.com/goreleaser/releaser) will automatically create a release.\n\n\n## License\n\n[MIT](./license)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqvl%2Fsleepto","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqvl%2Fsleepto","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqvl%2Fsleepto/lists"}