概述
利用“任務(wù)計(jì)劃”,可以將任何腳本、程序或文檔安排在某個(gè)最方便的時(shí)間運(yùn)行。通俗的講就是定時(shí)執(zhí)行某個(gè)腳本、程序。
常見用途
定時(shí)關(guān)機(jī)
定時(shí)檢查更新
定時(shí)對(duì)系統(tǒng)配置、數(shù)據(jù)庫(kù)、日志進(jìn)行備份
定時(shí)清理垃圾文件
檢測(cè)是否已安裝
# crontab-bash: crontab: command not found
執(zhí)行 crontab 命令如果報(bào) command not found,就表明沒有安裝.
開始安裝
# yum -y install vixie-cronLoaded plugins: fastestmirror, refresh-packagekit, securityExisting lock /var/run/yum.pid: another copy is running as pid 25960.Another app is currently holding the yum lock; waiting for it to exit...
可能是系統(tǒng)自動(dòng)升級(jí)正在運(yùn)行,yum在鎖定狀態(tài)中。
可以通過強(qiáng)制關(guān)掉yum進(jìn)程:
#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 kB 00:00 extras | 3.4 kB 00:00 extras/primary_db | 32 kB 00:00 updates | 3.4 kB 00:00 updates/primary_db | 1.9 MB 00:07 Setting 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=============================================================================================================================================================================================== Package Arch Version Repository Size===============================================================================================================================================================================================Installing: cronie x86_64 1.4.4-15.el6 base 74 kInstalling for dependencies: cronie-anacron x86_64 1.4.4-15.el6 base 31 k crontabs noarch 1.10-33.el6 base 10 k procmail x86_64 3.22-25.1.el6_5.1 base 162 k sendmail x86_64 8.14.4-9.el6 base 716 kTransaction Summary===============================================================================================================================================================================================Install 5 Package(s)Total download size: 994 kInstalled size: 2.1 MDownloading Packages:(1/5): cronie-1.4.4-15.el6.x86_64.rpm | 74 kB 00:00 (2/5): cronie-anacron-1.4.4-15.el6.x86_64.rpm | 31 kB 00:00 (3/5): crontabs-1.10-33.el6.noarch.rpm | 10 kB 00:00 (4/5): procmail-3.22-25.1.el6_5.1.x86_64.rpm | 162 kB 00:00 (5/5): sendmail-8.14.4-9.el6.x86_64.rpm | 716 kB 00:00 -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------Total 1.3 MB/s | 994 kB 00:00 Running rpm_check_debugRunning Transaction TestTransaction Test SucceededRunning Transaction Installing : procmail-3.22-25.1.el6_5.1.x86_64 1/5 Installing : sendmail-8.14.4-9.el6.x86_64 2/5 Installing : cronie-1.4.4-15.el6.x86_64 3/5 Installing : crontabs-1.10-33.el6.noarch 4/5 Installing : cronie-anacron-1.4.4-15.el6.x86_64 5/5 ERROR:dbus.proxies:Introspect error on :1.2513:/org/freedesktop/PackageKit: dbus.exceptions.DBusException: org.freedesktop.DBus.Error.NoReply: 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.noarch 1/5 Verifying : cronie-anacron-1.4.4-15.el6.x86_64 2/5 Verifying : sendmail-8.14.4-9.el6.x86_64 3/5 Verifying : cronie-1.4.4-15.el6.x86_64 4/5 Verifying : procmail-3.22-25.1.el6_5.1.x86_64 5/5 Installed: cronie.x86_64 0:1.4.415.el6 Dependency Installed: cronie-anacron.x86_64 0:1.4.4-15.el6 crontabs.noarch 0:1.10-33.el6 procmail.x86_64 0:3.22-25.1.el6_5.1 sendmail.x86_64 0:8.14.4-9.el6 Complete!
查看命令幫助
crontab 并不支持-h或 主站蜘蛛池模板: 91短视频版高清在线观看www | 久久国语对白 | 成人 精品| 美女羞羞视频在线观看 | 欧美成年性h版影视中文字幕 | 精品久久久久久久久久久αⅴ | 高潮娇喘嗯啊~文字 | 欧美日韩精品中文字幕 | 热99re久久免费视精品频软件 | 国产精品99精品 | 成年性羞羞视频免费观看 | 国产成人高清在线观看 | 天天色综合6 | 精品一区二区三区毛片 | 国产亚洲精品综合一区91 | 亚洲一区二区三区高清 | 久久久久久久99 | 7777奇米成人四色影视 | 中国免费黄色 | 精品国产一区二区三区久久久狼牙 | 自拍偷拍亚洲图片 | 国产日本欧美在线观看 | 国产亚洲精品成人 | 一级国产精品一级国产精品片 | 欧美一级小视频 | 99亚洲伊人久久精品影院红桃 | 在线播放黄色网址 | 日韩中文字幕三区 | hdjapanesemassagehd日本 | 欧美大荫蒂xxx | 88xx成人永久免费观看 | 动漫孕妇被羞羞视频 | 久久久久电影网站 | 国产一区二区精品91 | 日本在线不卡一区二区 | 91色琪琪电影亚洲精品久久 | 91成人免费看片 | 法国性xxx精品hd | 免费久久久久久 | 亚洲乱操 | 国产精品99久久99久久久二 |