TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Cron commands to plain English

85 pointsby spncr2almost 11 years ago

15 comments

currysausagealmost 11 years ago
<i>&gt; the arcane syntax</i><p>Arcane, seriously? What kind of syntax would be modern and clear in your opinion? YAML? JSON? XML probably, with a nice 150-page <i>XTBJSPCOSDF (Extensible Time-Based Job Scheduling for POSIX-Compatible Operating Systems Description Framework)</i> spec? ;)<p>Personally, I think this is pretty straightforward:<p><pre><code> #minute hour mday month wday command 30 1 * * * &#x2F;bin&#x2F;sh &#x2F;etc&#x2F;daily 30 3 * * 6 &#x2F;bin&#x2F;sh &#x2F;etc&#x2F;weekly 30 5 1 * * &#x2F;bin&#x2F;sh &#x2F;etc&#x2F;monthly</code></pre>
sprobertsonalmost 11 years ago
I&#x27;d dig something going in the opposite direction! Especially packed in a shell script, e.g. `cronglish &quot;echo testing&quot; every half hour &gt;&gt; ~&#x2F;.crontab`
ColinWrightalmost 11 years ago
OK, so I gave it this:<p><pre><code> 8-59&#x2F;30 * * * * do_something </code></pre> It replied:<p><pre><code> The command do_something will execute the 8th through 59&#x2F;30th minutes of every hour every day. </code></pre> That&#x27;s a pretty poor description of something that will run at 8 and 38 minutes past the hour, every hour of every day.<p>Not impressed - seems overly simplistic.
评论 #8124915 未加载
thomseddonalmost 11 years ago
I built the opposite version of this, convert plain English to cron commands: <a href="http://thomseddon.github.io/cronstring" rel="nofollow">http:&#x2F;&#x2F;thomseddon.github.io&#x2F;cronstring</a>
评论 #8123382 未加载
iwalton3almost 11 years ago
You can also use DuckDuckGo to do this: <a href="https://duckduckgo.com/?q=cron+0+0+*+*+*+some_report.sh&amp;t=lm" rel="nofollow">https:&#x2F;&#x2F;duckduckgo.com&#x2F;?q=cron+0+0+*+*+*+some_report.sh&amp;t=lm</a>
评论 #8122915 未加载
mike-cardwellalmost 11 years ago
Does not understand this syntax: &quot;1-56&#x2F;5 * * * * foo&quot;
评论 #8124921 未加载
评论 #8123106 未加载
geekraxalmost 11 years ago
Just played a bit with it. <a href="http://goo.gl/q8lT9B" rel="nofollow">http:&#x2F;&#x2F;goo.gl&#x2F;q8lT9B</a>
budu3almost 11 years ago
Looks like they&#x27;re the chaps behind <a href="https://deadmanssnitch.com" rel="nofollow">https:&#x2F;&#x2F;deadmanssnitch.com</a> which looks like a simple and useful service.
评论 #8124927 未加载
ddlathamalmost 11 years ago
It would be great to also list the next few datetimes that this would occur on as examples.<p>It would also be great to support the seconds field.
评论 #8124773 未加载
jchavannesalmost 11 years ago
For visualizing a large quantity of crons, I&#x27;d recommend something akin to <a href="https://github.com/federatedmedia/cronviz" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;federatedmedia&#x2F;cronviz</a> which will graphically show when jobs are scheduled to run.
_kst_almost 11 years ago
@reboot cd ~&#x2F;bin&#x2F;some_daemon<p>is not a very good example. It will launch a shell which will change to the specified directory and then terminate. (It might produce an error message if the directory doesn&#x27;t exist.)
pwenzelalmost 11 years ago
This is nice.<p>I also turn to <a href="http://cronwtf.github.io" rel="nofollow">http:&#x2F;&#x2F;cronwtf.github.io</a> when I need to sanity-check my crontab, which is a little more verbose and includes JSSpec tests.
gavalmost 11 years ago
Also see crontab2english: <a href="http://interglacial.com/pub/crontab2english.html" rel="nofollow">http:&#x2F;&#x2F;interglacial.com&#x2F;pub&#x2F;crontab2english.html</a>
LiveTheDreamalmost 11 years ago
I&#x27;ve been using <a href="http://cronwtf.github.io/" rel="nofollow">http:&#x2F;&#x2F;cronwtf.github.io&#x2F;</a> for years to double-check cron expressions.
callesggalmost 11 years ago
Not bad, each line in my cron has somthing lke that next to it :)