Jump to content

Talk:Cron: Difference between revisions

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Content deleted Content added
SineBot (talk | contribs)
m Signing comment by Dat789 - "Code Examples: "
Dat789 (talk | contribs)
: 31 example */
Line 111: Line 111:


I'm not an expert in these things, but there is an example of */31 in the minute field. Wouldn't that run twice, since 0 mod 31 = 0 and 31 mod 31 = 0? <span style="font-size: smaller;" class="autosigned">—Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/99.19.10.103|99.19.10.103]] ([[User talk:99.19.10.103|talk]]) 05:18, 9 August 2009 (UTC)</span><!-- Template:UnsignedIP --> <!--Autosigned by SineBot-->
I'm not an expert in these things, but there is an example of */31 in the minute field. Wouldn't that run twice, since 0 mod 31 = 0 and 31 mod 31 = 0? <span style="font-size: smaller;" class="autosigned">—Preceding [[Wikipedia:Signatures|unsigned]] comment added by [[Special:Contributions/99.19.10.103|99.19.10.103]] ([[User talk:99.19.10.103|talk]]) 05:18, 9 August 2009 (UTC)</span><!-- Template:UnsignedIP --> <!--Autosigned by SineBot-->

You can ask technical questions like this on forums. Here, we should provide a general working examples that can be reworked into a solution. Dat789 10:52, 19 February 2015 (UTC)


== CRON expressions ==
== CRON expressions ==

Revision as of 10:52, 19 February 2015

WikiProject iconComputing: Software B‑class Mid‑importance
WikiProject iconThis article is within the scope of WikiProject Computing, a collaborative effort to improve the coverage of computers, computing, and information technology on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
BThis article has been rated as B-class on Wikipedia's content assessment scale.
MidThis article has been rated as Mid-importance on the project's importance scale.
Taskforce icon
This article is supported by WikiProject Software (assessed as Mid-importance).

History

I wrote this article, adapting from something written a while back, because, to me, cron is the main topic, not crontab. I am sketchy on what came before V7 and "Kernighan's cron" as we called it at Purdue and also a bit sketchy on the subsequent implementations. I hope others can round this out. I didn't really know that my cron got into "the real Unix" until I took a job at SGI in 1990 and looked at the source code and instantly recognized the awful coding style (no spaces, lots of asterisks in comments) I used as a grad student. I think Keith wrote the hardest part: figuring out the NEXT minute in the future that any particular crontab entry should be run, with out walking forward minute-by-minute asking the binary question, "now?" It took a while to debug that.

A few years back I tried to convince the Purdue Research Foundation that they should claim title to the Unix cron but we didn't save notebooks or even e-mails from those days...this was 1979!! So they chose to just let it fall by. I suspect a lot of code in Unix was written by grad students like me and Keith. Another one of those "warm up project" I designed was given to Chris Kent/Kantarjiev and the "pg" command in Unix came out of it. But everyone uses "more" now...though I believe pg was the first paginator that would allow you to go backwards, even if you piped output to it!

I apologize for any deviations from standards and style and decorum and trust the community will correct these or instruct me on how to do so...or both!

Rlb408 02:11, 9 February 2007 (UTC)[reply]

Not the crontab article

Unsure why someone added the description of the crontab fields at the top of the article. This topic is cron, not crontab. The format of cron's spec file is incidental to the topic and I think distracts. Since there is a separate article on crontab and this artile is about the history and algorithm, can we just delete the crontab format description from here? As an analogy, if there were an article about compiler optimization algorithms, would you put a description of the syntax of the language itself in that article? How very odd.

Rlb408 07:32, 17 February 2007 (UTC)[reply]

cron and DST changes

Is Vixie cron the only cron that can not tolerate changes to daylight savings time rules while running? (See http://doughboy.wordpress.com/2007/03/14/vixie-cron-and-the-new-us-dst/.) If so, maybe a note belongs there. If it affects many crons, then a note should go here.--Theodore Kloba 13:59, 26 March 2007 (UTC)[reply]


apparent crontab inconsistency

I will leave to others the editorial decision as to whether the crontab format is appropriate to include in the cron entry. However the documented range of 0-6 and the statement that either 0 or 6 conveys a Sunday for DOW (day of week) appears to be contradicted by the statement that both 0 and 7 are considered Sunday, although 7 is considered trayf* on AIX manpages.

I find it hard to believe that 0, 6 and 7 are all intended. A Unix guru might be able to verify this point in relation to difrferent Unix flavors.

--Ed Smiley

"... on a 1 MIP system ..."

What does MIP mean in the text? It's wikilink goes to a disambiguation page whose entries don't make it obvious (for me). Could someone fix the wikilink so it goes to a page describing the "MIP" being talked about? --Zabadab (Talk) @ 12:37, 27 May 2007 (UTC)[reply]

Fixed it. IPS stands per instructions per second, and the M stands for million. Sometimes people get confused and think it's 2 MIPS but 1 MIP, but, if you think about it, that's a wee mistake. Nicol (Talk) 14:01, 30 May 2007 (UTC)[reply]

Acronym

"CRON" is an acronym that stands for "Command Run ON"

That's probably not right. Sounds too much like "Unix System Resources", "Extended Tool Chest", and other such poor attempts to explain Unix terms. --193.77.238.223 14:24, 26 July 2007 (UTC)[reply]

Code Examples

It would be great if someone could include what different commands you can set a cron job up to. I had to spend too much time trying to figure out how to run a php script once a day...

I will come up with a couple of examples on things you can do with cron. -- dat789 — Preceding unsigned comment added by Dat789 (talkcontribs) 10:31, 19 February 2015 (UTC)[reply]

Merge

The following discussion is closed. Please do not modify it. Subsequent comments should be made in a new section.

There's no reason for the current split. The articles are inextricably linked and short enough that a merge would be a good idea. Chris Cunningham 17:56, 29 August 2007 (UTC)[reply]

Oppose: While they surely originated together, CRON expressions have come to be much more widely used than in CRON. They have become the de facto standard for creating scheduling definitions. Thus, the link goes only one way, that is, from this article to CRON expressions, and not the other way round. Also, the article on the secondary topic (CRON expression) is currently larger than the would-be main one (cron), which I think makes it not a good idea. --uKER (talk) 17:15, 2 April 2010 (UTC)[reply]
Support per Chris. To most readers this distinction will be hair-splitting. That the format of a crontab file may now be used elsewhere is not sufficient to warrant separation. (In any case CRON expression is an abnormally cased article name - cron is not an acronym.) Globbet (talk) 21:37, 8 June 2010 (UTC)[reply]
Support you can still link to the page section as such: cron#cron expression. People are unlikely to search for "CRON expression." I am yet to be provided with any references that suggest this expression is used outside of interacting with the cron command. Even if it was used elsewhere, it still doesn't mean it should get its own article.--Bxj (talk) 10:53, 27 July 2010 (UTC)[reply]
Support CRON expression is not notable except as a part of cron, and the article itself seems little more than how-to content. me_and 18:17, 18 October 2010 (UTC)[reply]

Merge done as per foregoing. -- P 1 9 9 • TALK 16:57, 3 March 2011 (UTC)[reply]

The discussion above is closed. Please do not modify it. Subsequent comments should be made on the appropriate discussion page. No further edits should be made to this discussion.

In "See also"...

Might and Magic II: Gates to Another World, which is set in a land called Cron

...does this really belong here? If anywhere, it should be at the top of the page, or in a disambiguation page. Warriorness (talk) 07:58, 19 December 2007 (UTC)[reply]

Nope. Moved. Chris Cunningham (talk) 13:48, 19 December 2007 (UTC)[reply]

Sketch for rework

Note to self or others: here is what I'd expect the article to say, if I directed one of my curious co-workers to it:

  • What it is in simple terms (lets you schedule commands to run periodically, without being logged in).
  • That it is enabled by default on most or all Unices.
  • What system administrators use it for (backups, cleanup, indexing ...)
  • What normal users use it for, and that they may not be allowed to.
  • The user interface (crontab(1), the file format, and the command's output mailed to the owner).
  • What the equivalent on Windows (if any) is called.
  • A reference to at/atd (Oh, it's there. Good.)
  • The history/algorithm stuff as-is, but not at the top of the article.
  • A pronunciation guide...is it kron (like the beginning of chronological), or cr??n (as in rhymes with pawn), or something else entirely? — Preceding unsigned comment added by 65.222.165.65 (talk) 13:29, 22 December 2011 (UTC)[reply]

JöG (talk) 22:33, 28 February 2008 (UTC)[reply]

Wikipedia is not a Unix reference manual

Just a matter of opinion, but the value of wikipedia is that it captures material that is not collected uniformly elsewhere. Based on this thinking, I prefer that we not turn it into a Unix or Linux reference manual; that will diminish its unique value. If I want to learn how to use cron or write a crontab file, I can look it up in any of the hundreds of online reference manuals or simply type "man crontab" in a shell window.

I would like this article and others like it to tell the back story. You're not going to find this in any reference manual. The article should address questions such as

  • where did this come from?
  • what are its inner workings?
  • what is the technical basis underlying it?
  • what, if any, controversy is there?

Imaging your son or daughter or niece or nephew was to write an essay on "how did such-and-such come about" - would a reference manual page help? Not much. Similarly, I think it is important that new developers in the present day fantastic flurry of open source understand that even something as widely used as the Unix cron was started by one grad student, joined by another, in the 70's no less.

So, to me, the value of wikipedia, specifically concerning cron, is that the distinctions of the various crons are not widely known and that the Unix version is algorithmly distinct from all of the others. Do anyone care about that? Very few people, I suspect, but that applies to so many wikipedia articles.

Let's leave the reference manual content in the reference manual or some "wikiUnixReference" site.

Rlb408 (talk) 19:39, 13 April 2008 (UTC)[reply]

I agree with the above user. I clicked on this link randomly from an external site, and I honestly cannot understand most of what this article is about. I have no background in Unix or programming, but I shouldn't have to in order to understand a Wikipedia page. This page needs a major overhaul.§

*/31 example

I'm not an expert in these things, but there is an example of */31 in the minute field. Wouldn't that run twice, since 0 mod 31 = 0 and 31 mod 31 = 0? —Preceding unsigned comment added by 99.19.10.103 (talk) 05:18, 9 August 2009 (UTC)[reply]

You can ask technical questions like this on forums. Here, we should provide a general working examples that can be reworked into a solution. Dat789 10:52, 19 February 2015 (UTC)

CRON expressions

For the second time, I have removed [information] which for some reason made a sad attempt at explaining CRON expressions. Anyone reading this article could probably be assumed to be familiar with CRON expressions, but in case they weren't they, can find an more than appropriate explanation on them in the appropriate article. Unless a merge was performed and expressions were then properly covered in this article, we're better off without that info given how terribly incomplete it is. --uKER (talk) 16:47, 2 April 2010 (UTC)[reply]

However, that article, CRON expression, describes an expression that includes seconds and year. That doesn't match the cron article. — Wdfarmer (talk) 17:51, 27 December 2010 (UTC)[reply]

The example documentation on the Quartz Scheduler site also makes use of a "seconds" field. http://www.quartz-scheduler.org/docs/tutorials/crontrigger.html —Preceding unsigned comment added by Charlieholder (talkcontribs) 15:28, 16 May 2011 (UTC)[reply]

Acronym

Is "Command Run ON" is an acronym or a fan's backronym? Lacrymocéphale 12:21, 13 October 2010 (UTC)[reply]

I've never heard of it called that. The article has the name coming from chronos, which makes much more sense to me. me_and 12:24, 13 October 2010 (UTC)[reply]
Me either. I asked because I'd like to understand why it is on fr:Cron. It can be found but in poor references. Lacrymocéphale 06:00, 19 May 2011 (UTC)[reply]

Pound

I tested it on my ubuntu, and it fails.

24 12 * * 4#2  echo "notOK" >> /tmp/test.txt
24 12 * * 4#3  echo "OK" >> /tmp/test.txt

my /tmp/test.txt showed both "notOK" and "OK".

Need source on that section!! —Preceding unsigned comment added by Fridim (talkcontribs) 10:38, 19 May 2011 (UTC)[reply]

Which implementations use the question mark?

Debian and Ubuntu GNU/Linux don't accept the question mark. Which cron implementations do? Gronky (talk) 15:27, 22 January 2012 (UTC)[reply]

At the end of the overview section it says

While normally the job is executed when the time/date specification fields all match the current time and date, there is one exception: if both "day of month" and "day of week" are restricted (not "*"), then either the "day of month" field (3) or the "day of week" field (5) must match the current day.

The emphasis on "either" and "or" makes it sound like if both match it doesn't run. This doesn't seem right. That's not how it works right? I recommend this wording instead:

While normally the job is executed when the time/date specification fields all match the current time and date, there is one exception: if both "day of month" and "day of week" are restricted (not "*"), then one or both must match the current day. — Preceding unsigned comment added by 173.243.55.194 (talk) 00:18, 12 July 2013 (UTC)[reply]