Centos7如何配置自动更新 - 开发说
当前位置: 主页 » Centos » Centos7如何配置自动更新


      2017年12月17日   阅读 1,597 次     0 评论   Tags: ·




yum install -y cronie yum-cron

/etc/yum/yum-cron.conf  (每天),
/etc/yum/yum-cron-hourly.conf  (每小时).

vi /etc/yum/yum-cron.conf
#  What kind of update to use:
# default                            = yum upgrade
# security                           = yum --security upgrade
# security-severity:Critical         = yum --sec-severity=Critical upgrade
# minimal                            = yum --bugfix update-minimal
# minimal-security                   = yum --security update-minimal
# minimal-security-severity:Critical =  --sec-severity=Critical update-minimal
update_cmd = default

apply_updates = yes
update_messages = yes
download_updates = yes

email_from = root@localhost
email_to = root
email_host = localhost

systemctl enable crond yum-cron

systemctl start crond yum-cron

In any of the two configuration files, configuration is defined through the following directives:

update_cmd = value specifies the category of upgrade where value can take:
default for yum upgrade,
security for yum –security upgrade,
security-severity:Critical for yum –sec-severity=Critical upgrade,
minimal for yum –bugfix upgrade-minimal,
minimal-security for yum –security upgrade-minimal,
minimal-security-severity:Critical for yum –sec-severity=Critical upgrade-minimal.
update_messages = yes/no defines whether a mail is sent when updates from the previously specified category are available.
download_updates = yes/no specifies whether these available updates need to be downloaded.
apply_updates = yes/no defines whether these available updates need to be applied.
random_sleep = 15 specifies the maximum time in minutes to randomly sleep preserving bandwidth and avoiding download storms.
emit_via = stdio/email/none defines what kind of message is used: stdio means written into the /var/log/cron file, email causes a mail to be sent, none doesn’t do anything.
email_from = root@localhost, email_to = root, email_host = localhost defines respectively when the message is a mail the originator’s email address, the recipient’s email address and the host to which the mail is sent.



  • 版权声明:本文版权归开发说和原作者所有,未经许可不得转载。文章部分来源于网络仅代表作者看法,如有不同观点,欢迎进行交流。除非注明,文章均由 开发说 整理发布,欢迎转载,转载请带版权。

  • 来源:开发说 ( https://www.kaifashuo.com/ ),提供主机优惠信息深度测评和服务器运维编程技术。
  • 链接:https://www.kaifashuo.com/172.html
  • 评论(0

    1. 还没有任何评论,你来说两句吧


    您的电子邮箱地址不会被公开。 必填项已用 * 标注