Centos 安装crontab及cron常用命令

1,872次阅读
没有评论

crontab是linux系统常用的一个定时执行任务的软件。VPS百科一直用centos,现在用的多的是Centos 7、8系统。

Centos 安装crontab及cron常用命令

这里,VPS百科就分享下Centos 7、Centos 8下安装crontab命令,以及crontab常用的一些启动、重启、状态查询等命令。当然,包括crontab随系统自启动命令。

Centos 7、Centos 8安装crontab:

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

Centos 7、Centos 8在命令行运行以上命令后,就安装好了crontab了。

Centos 7、Centos 8下常用crontab命令:

/bin/systemctl start crond
/bin/systemctl stop crond
/bin/systemctl restart crond
/bin/systemctl reload crond
/bin/systemctl status crond

VPS百科就就不多介绍了,大家监督看不同的英文含义,如start肯定是启动crontab了,其它类推。

Centos 7、Centos 8下crontab开机运行命令:

systemctl enable crond.service

附上crontab常用命令:

crontab -u    //设定某个用户的cron服务
crontab -l     //列出某个用户cron服务的详细内容
crontab -r    //删除某个用户的cron服务
crontab -e    //编辑某个用户的cron服务
crontab -i    //打印提示,输入yes等确认信息

好了,就记录这么多,VPS百科自己用起来挺方便的多了,哈哈~~~

正文完
 
VPS百科小编
版权声明:本站原创文章,由 VPS百科小编 2020-12-17发表,共计709字。
转载说明:
评论(没有评论)