cron和crontab的区别? [英] Difference between Cron and Crontab?

查看:587
本文介绍了cron和crontab的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不能够理解这个问题的答案:什么和的cron 之间的差异的crontab 。 难道他们都调度一个执行一次文件和其他执行定期间隔的文件或不的cron 调度作业和的crontab 将它们存储在执行一个表或文件?

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 executing the files once and the other executing the files on a regular interval OR does cron schedule a job and crontab stores them in a table or file for execution?

Wiki页面 的Cron 提到:

的Cron 由一个crontab(cron表)文件驱动,配置文件
  指定在给定的时间表定期运行shell命令。

Cron is driven by a crontab (cron table) file, a configuration file that specifies shell commands to run periodically on a given schedule.

wiki.dreamhost 的crontab mentiones:

But wiki.dreamhost for crontab mentiones :

crontab命令,在Unix和类Unix操作系统上发现的,是
  用于调度命令来周期性地执行。它读取
  系列从标准输入的命令来收集这些信息到一个文件
  称为的crontab,这是以后读取,其说明在
  进行。

The crontab command, found in Unix and Unix-like operating systems, is used to schedule commands to be executed periodically. It reads a series of commands from standard input and collects them into a file known as a "crontab" which is later read and whose instructions are carried out.

具体而言,当我安排一个工作被重复:(从维基报价的)

Specifically, When I schedule a job to be repeated : (Quoting from wiki)

1 0 * * *  printf > /var/log/apache/error_log

或仅一次执行作业

at -f myScripts/call_show_fn.sh 1:55 2014-10-14

我在这两者在推的crontab 或者说是第一个的命令做了的cron 功能的crontab ,第二个的cron 功能?

Am I doing a cron function in both the commands which is pushed in crontab OR is the first one a crontab and the second a cron function?

推荐答案

的cron 是运行计划操作的服务的总称。 的crond 是在后台运行,并读的crontab 文件守护进程的名称。 A 的crontab 是包含作业格式的文件

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

的cron的各个实施。通常会有每个用户的crontab文件(用命令来访问 crontab -e命令),以及在 /etc/cron.daily <系统的crontab / code>,里:

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.

在你的第一个例子中,你正在计划通过一个crontab的工作。在第二个例子中,你正在使用的命令队列中用于以后的执行工作。

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.

这篇关于cron和crontab的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆