Difference between Cron and Crontab?

后端 未结 1 920
执念已碎
执念已碎 2021-01-30 20:23

I am not able to understand the answer for this question: \"What\'s the difference between cron and crontab.\" Are they both schedulers with one execut

1条回答
  •  -上瘾入骨i
    2021-01-30 21:01

    cron is the general name for the service that runs scheduled actions. crond is the name of the daemon that runs in the background and reads crontab files. A crontab is a file containing jobs in the format

    minute hour day-of-month month day-of-week  command
    

    crontabs are normally stored by the system in /var/spool//crontab. These files are not meant to be edited directly. You can use the crontab command to invoke a text editor (what you have defined for the EDITOR env variable) to modify a crontab file.

    There are various implementations of cron. Commonly there will be per-user crontab files (accessed with the command crontab -e) as well as system crontabs in /etc/cron.daily, /etc/cron.hourly, etc.

    In your first example you are scheduling a job via a crontab. In your second example you're using the at command to queue a job for later execution.

    0 讨论(0)
提交回复
热议问题