ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Linux提示crontab command not found的解决方法

Linux提示crontab command not found的解决方法

原创 Linux操作系统 作者:arisono 时间:2021-05-22 22:07:49 0 删除 编辑
# 查看定时任务列表
crontab -l

报错提示: - bash: crontab: command not found

# 安装之前,先删除
 yum remove cronie
# 安装cronie
 yum -y  install cronie

安装依旧报错:

Total download size: 92 k
Installed size: 215 k
Downloading packages:Delta RPMs disabled because /usr/bin/applydeltarpm not installed.cronie-1.4.11-23.el7.x86_64.rpm                                                                                                  |  92 kB  00:00:00     Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : cronie-1.4.11-23.el7.x86_64                                                                                                          1/1 Error unpacking rpm package cronie-1.4.11-23.el7.x86_64
error: unpacking of archive failed on file /etc/cron.d/0hourly;60a90564: cpio: open
  Verifying  : cronie-1.4.11-23.el7.x86_64                                                                                                          1/1 Failed:
  cronie.x86_64 0:1.4.11-23.el7

报错提示:

Delta RPMs disabled because /usr/bin/applydeltarpm not installed.

发现需要安装deltarpm

yum -y install deltarpm

安装deltarpm成功之后继续安装 yum -y install cronie

新的报错提示:

Error unpacking rpm package cronie-1.4.11-23.el7.x86_64
error: unpacking of archive failed on file /etc/cron.d/0hourly;60a90661: cpio: open

解决方法【去除特殊属性-i -a】:

[root@iZuf6bm7y86rsciyk4lvriZ ~]# find / -name "crontab"/var/lib/docker/overlay2/ef655c7ec12a300ff857c07225d0556025f494da1755aa038c88b86fbd876ccf/diff/usr/bin/crontab/etc/crontab[root@iZuf6bm7y86rsciyk4lvriZ ~]# lsattr /etc/crontab----ia-------e-- /etc/crontab[root@iZuf6bm7y86rsciyk4lvriZ ~]# chattr -i -a /etc/crontab[root@iZuf6bm7y86rsciyk4lvriZ ~]# lsattr /etc/crontab

去除特殊属性
chattr -i -a /etc/crontab

然后重新安装:yum -y install cronie


然后可以执行命令,安装成功。

查看Linux定时任务:

#查看定时任务
crontab -l

原文地址: https://www.yundashi168.com/278.html


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69988117/viewspace-2773517/ ,如需转载,请注明出处,否则将追究法律责任。

下一篇: 没有了~
请登录后发表评论 登录
全部评论
主机精选优惠网(分享优质的零基础小白建站教程,经验和国内外的主机活动信息|当然还有企业运维方面的知识):http://tencent.yundashi168.com

注册时间:2020-11-09

  • 博文量
    14
  • 访问量
    21050