{"id":6676,"date":"2017-05-08T12:35:42","date_gmt":"2017-05-08T04:35:42","guid":{"rendered":"http:\/\/rmohan.com\/?p=6676"},"modified":"2017-05-08T12:35:42","modified_gmt":"2017-05-08T04:35:42","slug":"centos-rhel-configure-yum-automatic-updates-with-yum-cron-service","status":"publish","type":"post","link":"https:\/\/mohan.sg\/?p=6676","title":{"rendered":"CentOS \/ RHEL : Configure yum automatic updates with yum-cron service"},"content":{"rendered":"<p>yum-cron is an optional package starting from Red Hat Enterprise Linux 6, this is a plugin for yum. From man page of yum-cron :<\/p>\n<p>yum-cron is a simple way to call yum commands from cron. It provides configuration to keep repository metadata up to date, and to check for, download, and apply updates.<br \/>\nThe yum-cron package provides a convenient way to check for, download and apply updates automatically. The cron jobs from the yum-cron package are active immediately after installing the package and there\u2019s no extra configuration necessary. The job will be run when your normal daily cron jobs are set to run.<\/p>\n<p>Installation<\/p>\n<p>To install yum-cron package<\/p>\n<p># yum -y install yum-cron<br \/>\n# chkconfig yum-cron on<br \/>\nConfiguration for RHEL 6<\/p>\n<p>Then edit \/etc\/sysconfig\/yum-cron to set MAILTO=[email address] for email notifications.<\/p>\n<p>MAILTO=sys@example.com<br \/>\nTo exclude packages using yum-cron edit the \/etc\/sysconfig\/yum-cron to have the packeges to be excluded in the automatic uodate :<\/p>\n<p>YUM_PARAMETER=kernel* mysql*<br \/>\nTo start yum-cron service after editing configuration file.<\/p>\n<p># service yum-cron start<br \/>\nConfiguration for RHEL 7<\/p>\n<p>Then edit \/etc\/yum\/yum-cron.conf to set email_to=[email address] for email notifications.<\/p>\n<p>email_to=sys@example.com<br \/>\nTo exclude packages using yum-cron edit the \/etc\/yum\/yum-cron.conf to have the packeges to be excluded in the automatic uodate :<\/p>\n<p>exclude=kernel* mysql*<br \/>\nIn RHEL 7 you can use following options in yum-cron configuration file, to install security updates.<\/p>\n<p>[commands]<br \/>\n#  What kind of update to use:<br \/>\n# default                            = yum upgrade<br \/>\n# security                           = yum &#8211;security upgrade<br \/>\n# security-severity:Critical         = yum &#8211;sec-severity=Critical upgrade<br \/>\n# minimal                            = yum &#8211;bugfix upgrade-minimal<br \/>\n# minimal-security                   = yum &#8211;security upgrade-minimal<br \/>\n# minimal-security-severity:Critical =  &#8211;sec-severity=Critical upgrade-minimal<br \/>\nupdate_cmd = default<br \/>\nTo start yum-cron service after editing configuration file.<\/p>\n<p># systemctl start yum-cron<\/p>\n","protected":false},"excerpt":{"rendered":"<p>yum-cron is an optional package starting from Red Hat Enterprise Linux 6, this is a plugin for yum. From man page of yum-cron :<\/p>\n<p>yum-cron is a simple way to call yum commands from cron. It provides configuration to keep repository metadata up to date, and to check for, download, and apply updates. The yum-cron [&#8230;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[73],"tags":[],"_links":{"self":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6676"}],"collection":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6676"}],"version-history":[{"count":1,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6676\/revisions"}],"predecessor-version":[{"id":6677,"href":"https:\/\/mohan.sg\/index.php?rest_route=\/wp\/v2\/posts\/6676\/revisions\/6677"}],"wp:attachment":[{"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6676"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6676"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mohan.sg\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6676"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}