35

Technically speaking, what is the difference between a cron, crontab, and cronjob?

From what I can gather, cron is the utility on the server, crontab is a file which contains the time intervals and commands, and cronjob is the actual command (or file/script which contains commands).

Is this correct?

Leo Galleguillos
  • 2,429
  • 3
  • 25
  • 43

4 Answers4

70

cron is the name of the tool, crontab is generally the file that lists the jobs that cron will be executing, and those jobs are, surprise surprise, cronjobs.

Marc B
  • 356,200
  • 43
  • 426
  • 500
  • 2
    Do you spell `cronjob` together or `cron job` separately? – ob-ivan Feb 05 '21 at 17:44
  • 2
    The correct term is “**`cron` job**” or “cron job”, not “`cronjob`”. (Sources: the [man page for Vixie cron](https://github.com/vixie/cron/blob/master/cron.8), the [man page for ISC Cron](https://man.netbsd.org/NetBSD-6.0/cron.8), and the [manual for GNU Mcron](https://www.gnu.org/software/mcron/manual/mcron.html) contain many usages of “job” as well as one usage of “cron job”, and do not contain “cronjob”.) – Rory O'Kane Jan 18 '22 at 17:03
  • What are the files in cron.d folder there are files - are called? Cron jobs? – variable Feb 25 '22 at 05:33
  • Cron tab is short for Cron Table – Janac Meena Mar 31 '22 at 14:45
  • Let's be real, most people know what you're talking about whether you say cronjob or cron job. It's just bunch of elisit who would scream at you for using cronjob or cron job. Potato tomato. – Ka Mok Jul 12 '23 at 15:53
29

Cron: Cron comes from chron, the Greek prefix for ‘time’. Cron is a daemon which runs at the times of system boot.

Crontab: Crontab (CRON TABle) is a file which contains the schedule of cron entries to be run and at specified times. File location varies by operating systems.

Cron job or cron schedule: Cron job or cron schedule is a specific set of execution instructions specifying day, time and command to execute. crontab can have multiple execution statements.

Reference: http://www.adminschoice.com/crontab-quick-reference

Arif I.
  • 1,993
  • 1
  • 16
  • 14
7

I am putting this here so I can find it again when I need it and to have a place for additional input from other people. I have read several pages on this topic (some contradictory, some with examples that do not work) So here is my current understanding:

There are 2 Daemons in Linux to schedule future tasks "cron" and "at"

The idea behind "at" is to be a tool to run one off (single) future jobs, there is a variation of "at" called "batch" which will run the jobs only if system resources are almost idle

"cron" is usually used by configuring the Chronological Table or (crontab), the idea behind the cron system is to set up jobs that need to be run repetitively in the future. While most cron jobs are set using the crontab command, the cron command can be used directly to do a one off. There is a alternative to crontab called anacron which can be used if your system is not on 24/7.

Nicole Cook
  • 316
  • 1
  • 5
  • 11
0

cron is a Unix, Solaris utility that allows tasks to be automatically run in the background at regular intervals by the cron daemon.

Crontab file A crontab file has five fields for specifying day, date and time followed by the command to be run at that interval.