日韩无码专区无码一级三级片|91人人爱网站中日韩无码电影|厨房大战丰满熟妇|AV高清无码在线免费观看|另类AV日韩少妇熟女|中文日本大黄一级黄色片|色情在线视频免费|亚洲成人特黄a片|黄片wwwav色图欧美|欧亚乱色一区二区三区

RELATEED CONSULTING
相關(guān)咨詢
選擇下列產(chǎn)品馬上在線溝通
服務(wù)時(shí)間:8:30-17:00
你可能遇到了下面的問(wèn)題
關(guān)閉右側(cè)工具欄

新聞中心

這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷解決方案
Linux下使用yum-cron自動(dòng)更新系統(tǒng)

yum-cron是一個(gè)RHEL/CentOS系統(tǒng)自動(dòng)更新的軟件。保持服務(wù)器系統(tǒng)實(shí)時(shí)更新是一個(gè)很好避免攻擊的辦法,本篇文章為大家講解一下Linux下使用yum-cron自動(dòng)更新系統(tǒng)具體方法。

首先需要安裝 yum-cron 軟件包。該軟件包提供以 cron 命令運(yùn)行 yum 更新所需的文件。如果你想要每晚通過(guò) cron 自動(dòng)更新可以安裝這個(gè)軟件包。 CentOS/RHEL 6.x/7.x 上安裝 yum cron 輸入以下 yum 命令:

$ sudo yum install yum-cron

使用 CentOS/RHEL 7.x 上的 systemctl 啟動(dòng)服務(wù):

$ sudo systemctl enable yum-cron.service
$ sudo systemctl start yum-cron.service
$ sudo systemctl status yum-cron.service

在 CentOS/RHEL 6.x 系統(tǒng)中,運(yùn)行:

$ sudo chkconfig yum-cron on
$ sudo service yum-cron start

yum-cron 是 yum 的一個(gè)替代方式。使得 cron 調(diào)用 yum 變得非常方便。該軟件提供了元數(shù)據(jù)更新、更新檢查、下載和安裝等功能。yum-cron 的各種功能可以使用配置文件配置,而不是輸入一堆復(fù)雜的命令行參數(shù)。

配置 yum-cron 自動(dòng)更新 RHEL/CentOS Linux 使用 vi 等編輯器編輯文件 /etc/yum/yum-cron.conf 和 /etc/yum/yum-cron-hourly.conf:

$ sudo vi /etc/yum/yum-cron.conf

確保更新可用時(shí)自動(dòng)更新:

apply_updates = yes

可以設(shè)置通知 email 的發(fā)件地址。注意: localhost將會(huì)被system_name` 的值代替。

email_from = root@localhost

列出發(fā)送到的 email 地址。

email_to = your-it-support@some-domain-name

發(fā)送 email 信息的主機(jī)名。

email_host = localhost

CentOS/RHEL 7.x 上不想更新內(nèi)核的話,添加以下內(nèi)容:

exclude=kernel*

RHEL/CentOS 6.x 下添加以下內(nèi)容來(lái)禁用內(nèi)核更新:

YUM_PARAMETER=kernel*

保存并關(guān)閉文件。如果想每小時(shí)更新系統(tǒng)的話修改文件 /etc/yum/yum-cron-hourly.conf,否則文件 /etc/yum/yum-cron.conf 將使用以下命令每天運(yùn)行一次(使用 cat 命令 查看):

$ cat /etc/cron.daily/0yum-daily.cron

示例輸出:

#!/bin/bash
# Only run if this flag is set. The flag is created by the yum-cron init
# script when the service is started -- this allows one to use chkconfig and
# the standard "service stop|start" commands to enable or disable yum-cron.
if [[ ! -f /var/lock/subsys/yum-cron ]]; then
exit 0
fi
# Action!
exec /usr/sbin/yum-cron /etc/yum/yum-cron-hourly.conf
[root@centos7-box yum]# cat /etc/cron.daily/0yum-daily.cron
#!/bin/bash
# Only run if this flag is set. The flag is created by the yum-cron init
# script when the service is started -- this allows one to use chkconfig and
# the standard "service stop|start" commands to enable or disable yum-cron.
if [[ ! -f /var/lock/subsys/yum-cron ]]; then
exit 0
fi
# Action!
exec /usr/sbin/yum-cron

完成配置。現(xiàn)在你的系統(tǒng)將每天自動(dòng)更新一次。更多細(xì)節(jié)請(qǐng)參照 yum-cron 的說(shuō)明手冊(cè)。


當(dāng)前文章:Linux下使用yum-cron自動(dòng)更新系統(tǒng)
文章出自:http://www.5511xx.com/article/cdcgijh.html