Linux Crontab 安装使用详细说明

yum -y install vixie-cron
yum -y install crontabs

说明:
vixie-cron 软件包是 cron 的主程序;
crontabs 软件包是用来安装、卸装、或列举用来驱动 cron 守护进程的表格的程序。

 

二、配置

cron 是 linux 的内置服务,但它不自动起来,可以用以下的方法启动、关闭这个服务:

service crond start     //启动服务
service crond stop      //关闭服务
service crond restart   //重启服务
service crond reload    //重新载入配置
service crond status    //查看crontab服务状态

 

在CentOS系统中加入开机自动启动: 

chkconfig --level 345 crond on

例子:

01 * * * * root run-parts /etc/cron.hourly
02 4 * * * root run-parts /etc/cron.daily
22 4 * * 0 root run-parts /etc/cron.weekly
42 4 1 * * root run-parts /etc/cron.monthly

 

posted @ 2018-02-24 16:00  leon_bin  阅读(194)  评论(0编辑  收藏  举报