CentOS下使用yum命令安装计划任务程序crontab

概述

利用“任务计划”,可以将任何脚本、程序或文档安排在某个最方便的时间运行。通俗的讲就是定时执行某个脚本、程序。

常见用途

定时关机 定时检查更新 定时对系统配置、数据库、日志进行备份 定时清理垃圾文件

检测是否已安装# crontab-bash: crontab:

执行 crontab 命令如果报 command not found,就表明没有安装.

开始安装# yum -y install vixie-cronLoaded plugins: fastestmirror, refresh-packagekit, securityExisting lock /var/pid 25960.Another app …

可能是系统自动升级正在运行,yum在锁定状态中。 可以通过强制关掉yum进程: #rm -f /var/run/yum.pid 然后就可以使用yum了。

# yum -y install vixie-cronLoaded plugins: fastestmirror, refresh-packagekit, securityDetermining fastest mirrors * base: mirrors.btte.net * extras: mirrors.sina.cn * updates: mirrors.sina.cnbase| 3.7 kB00:00extras| 3.4 kB00:00extras/primary_db| 32 kB00:00updates| 3.4 kB00:00updates/primary_db| 1.9 MB00:07Setting up Install ProcessResolving Dependencies–> Running transaction check—> Package cronie.x86_64 0:1.4.4-15.el6 will be installed–> Processing Dependency: dailyjobs for package: cronie-1.4.4-15.el6.x86_64–> Processing Dependency: /usr/sbin/sendmail for package: cronie-1.4.4-15.el6.x86_64–> Running transaction check—> Package cronie-anacron.x86_64 0:1.4.4-15.el6 will be installed–> Processing Dependency: crontabs for package: cronie-anacron-1.4.4-15.el6.x86_64—> Package sendmail.x86_64 0:8.14.4-9.el6 will be installed–> Processing Dependency: procmail for package: sendmail-8.14.4-9.el6.x86_64–> Running transaction check—> Package crontabs.noarch 0:1.10-33.el6 will be installed—> Package procmail.x86_64 0:3.22-25.1.el6_5.1 will be installed–> Finished Dependency ResolutionDependencies Resolved=============================================================================================================================================================================================== PackageArchVersionRepositorySize===============================================================================================================================================================================================Installing: croniex86_641.4.4-15.el6base74 kInstalling for dependencies: cronie-anacronx86_641.4.4-15.el6base31 k crontabsnoarch1.10-33.el6base10 k procmailx86_643.22-25.1.el6_5.1base162 k sendmailx86_648.14.4-9.el6base716 kTransaction Summary===============================================================================================================================================================================================Install5 Package(s)Total download size: 994 kInstalled size: 2.1 MDownloading Packages:(1/5): cronie-1.4.4-15.el6.x86_64.rpm| 74 kB00:00(2/5): cronie-anacron-1.4.4-15.el6.x86_64.rpm| 31 kB00:00(3/5): crontabs-1.10-33.el6.noarch.rpm| 10 kB00:00(86_64.rpm| 162 kB00:00(5/5): sendmail-8.14.4-9.el6.x86_64.rpm| 716 kB00:00———————————————————————————————————————————————————————————————–Total1.3 MB/s | 994 kB00:00Running rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning Transaction Installing : procmail-86_641/5 Installing : sendmail-8.14.4-9.el6.x86_642/5 Installing : cronie-1.4.4-15.el6.x86_643/5 Installing : crontabs-1.10-33.el6.noarch4/5 Installing : cronie-anacron-dbus: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.Unable to send message to PackageKit Verifying : crontabs-1.10-33.el6.noarch1/5 Verifying : cronie-anacron-1.4.4-15.el6.x86_642/5 Verifying : sendmail-8.14.4-9.el6.x86_643/5 Verifying : cronie-1.4.4-15.el6.x86_644/5 Verifying : procmail-86_645/5 Installed: cronie.x86_64 0:1.4.4-15.el6Dependency Installed: cronie-anacron:-9.el6Complete!查看命令帮助积极的人在每一次忧患中都看到一个机会,

CentOS下使用yum命令安装计划任务程序crontab

相关文章:

你感兴趣的文章:

标签云: