Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/keilerkonzept/cron-wait
Waits (once) until a given cron expression would trigger. single binary, no dependencies. osx & linux & windows. #golang #cli
https://github.com/keilerkonzept/cron-wait
cli cron crontab golang self-contained wait
Last synced: 29 days ago
JSON representation
Waits (once) until a given cron expression would trigger. single binary, no dependencies. osx & linux & windows. #golang #cli
- Host: GitHub
- URL: https://github.com/keilerkonzept/cron-wait
- Owner: keilerkonzept
- Created: 2020-07-09T21:01:08.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-03-18T05:56:03.000Z (almost 2 years ago)
- Last Synced: 2024-06-21T16:41:40.680Z (6 months ago)
- Topics: cli, cron, crontab, golang, self-contained, wait
- Language: Go
- Homepage:
- Size: 249 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# cron-wait
A tiny tool that waits until a given cron expression would trigger, and then just exits. If multiple expressions are given, it waits until the _first_ (earliest) match.
![image](doc/screenshot.png)
## Examples
```sh
$ cron-wait "*/5 * * * *"
[cron-wait] 2020/07/10 11:59:29.965045 waiting 30.035156s until next match (2020-07-10T12:00:00+02:00) of cron expression ["*/5 * * * *"]
[cron-wait] 2020/07/10 12:00:00.966919 done
``````sh
$ cron-wait -print-next-match-and-exit "*/3 * * * *"
2020-07-10T12:48:00+02:00
``````sh
$ cron-wait -print-delta-and-exit "@hourly"
3308.674034
```## Contents
- [Get it](#get-it)
- [Usage](#usage)## Get it
Using go get:
```bash
go get -u github.com/keilerkonzept/cron-wait
```Or [download the binary for your platform](https://github.com/keilerkonzept/cron-wait/releases/latest) from the releases page.
## Usage
```text
cron-wait [OPTIONS] [CRON_EXPRESSION [CRON_EXPRESSIONS...]]Usage of cron-wait:
-dots
Print dots to stdout while waiting
-format string
Timestamp format (default "2006-01-02T15:04:05Z07:00")
-print-delta-and-exit
Only print the duration (in seconds) until the next expression match and exit (without waiting)
-print-next-match-and-exit
Only print the timestamp of the next expression match and exit (without waiting)
-q (alias for -quiet)
-quiet
Suppress all output
```