mirror of
https://github.com/jbranchaud/til
synced 2026-01-03 07:08:01 +00:00
Add Interpret Cron Schedule From The CLI as a Unix TIL
This commit is contained in:
@@ -10,7 +10,7 @@ pairing with smart people at Hashrocket.
|
|||||||
|
|
||||||
For a steady stream of TILs, [sign up for my newsletter](https://crafty-builder-6996.ck.page/e169c61186).
|
For a steady stream of TILs, [sign up for my newsletter](https://crafty-builder-6996.ck.page/e169c61186).
|
||||||
|
|
||||||
_1640 TILs and counting..._
|
_1641 TILs and counting..._
|
||||||
|
|
||||||
See some of the other learning resources I work on:
|
See some of the other learning resources I work on:
|
||||||
- [Get Started with Vimium](https://egghead.io/courses/get-started-with-vimium~3t5f7)
|
- [Get Started with Vimium](https://egghead.io/courses/get-started-with-vimium~3t5f7)
|
||||||
@@ -1603,6 +1603,7 @@ If you've learned something here, support my efforts writing daily TILs by
|
|||||||
- [Include Ignore Files In Ripgrep Search](unix/include-ignore-files-in-ripgrep-search.md)
|
- [Include Ignore Files In Ripgrep Search](unix/include-ignore-files-in-ripgrep-search.md)
|
||||||
- [Interactively Browse Available Node Versions](unix/interactively-browse-availabile-node-versions.md)
|
- [Interactively Browse Available Node Versions](unix/interactively-browse-availabile-node-versions.md)
|
||||||
- [Interactively Switch asdf Package Versions](unix/interactively-switch-asdf-package-versions.md)
|
- [Interactively Switch asdf Package Versions](unix/interactively-switch-asdf-package-versions.md)
|
||||||
|
- [Interpret Cron Schedule From The CLI](unix/interpret-cron-schedule-from-the-cli.md)
|
||||||
- [Jump To The Ends Of Your Shell History](unix/jump-to-the-ends-of-your-shell-history.md)
|
- [Jump To The Ends Of Your Shell History](unix/jump-to-the-ends-of-your-shell-history.md)
|
||||||
- [Kill Everything Running On A Certain Port](unix/kill-everything-running-on-a-certain-port.md)
|
- [Kill Everything Running On A Certain Port](unix/kill-everything-running-on-a-certain-port.md)
|
||||||
- [Killing A Frozen SSH Session](unix/killing-a-frozen-ssh-session.md)
|
- [Killing A Frozen SSH Session](unix/killing-a-frozen-ssh-session.md)
|
||||||
|
|||||||
22
unix/interpret-cron-schedule-from-the-cli.md
Normal file
22
unix/interpret-cron-schedule-from-the-cli.md
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
# Interpret Cron Schedule From The CLI
|
||||||
|
|
||||||
|
I encounter cron task schedules infrequently enough that I don't remember how
|
||||||
|
to reliably interpret them at a glance. So when I'm looking over some code and
|
||||||
|
I see something like `12 2,16 * * *`, I need to translate it to a
|
||||||
|
human-readable format.
|
||||||
|
|
||||||
|
I've typically opened up a browser tab to
|
||||||
|
[crontab.guru](https://crontab.guru/#12_2,16_*_*_*) for this. However, I did
|
||||||
|
just learn about a tool for getting the same information from the CLI.
|
||||||
|
|
||||||
|
With the [`hcron`](https://github.com/lnquy/cron) binary, I can pass in a
|
||||||
|
single cron schedule and get the same details right from my terminal.
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ hcron '12 2,16 * * *'
|
||||||
|
12 2,16 * * *: At 02:12 AM and 04:12 PM
|
||||||
|
```
|
||||||
|
|
||||||
|
I decided to clone this repo, build the binary from source (it is Go), and then
|
||||||
|
place the `hcron` binary in my `~/bin` directory which is on my path. Once I
|
||||||
|
did that, I could start using the command like above.
|
||||||
Reference in New Issue
Block a user