Get the App
SLTechnology News&Howtos  ›  Development  › 

How to solve the command not found problem in crontab

Shulou Source: shulou.com Published: 2022-06-03 14:27:43 10月03日 Update

This article will explain in detail how to solve the command not found problem in crontab. The content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

# View scheduled task list crontab-l

Error message:-bash: crontab: command not found

# remove yum remove cronie# and install cronie yum-y install cronie before installation

The installation still reports an error:

Total download size: 92 kInstalled size: 215 kDownloading 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 checkRunning transaction testTransaction test succeededRunning transaction Installing: cronie-1.4.11-23. El7.x86_64 1 Error unpacking rpm package cronie-1.4.11-23.el7.x86_64error: unpacking of archive failed on file / etc/cron.d/0hourly 60a90564: cpio: open Verifying: cronie-1.4.11-23.el7.x86_64 1Acer 1 Failed: cronie.x86_64 0VX 1.4.11-23.el7

Error message:

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

Found that deltarpm needs to be installed

Yum-y install deltarpm

Continue to install yum-y install cronie after successful installation of deltarpm

New error message:

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

Solution [remove special attribute-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

Remove special attributes chattr-I-a / etc/crontab

Then reinstall: yum-y install cronie

The command can then be executed and the installation is successful.

View Linux scheduled tasks:

# View scheduled tasks crontab-l

On how to solve the command not found problem in crontab to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Tags: Tasks tips questions special success content attributes articles more knowledge articles good commands methods quality references help related Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB Shulou Technology Docker Shulou Information vpn