{"id":19120,"date":"2016-01-10T11:34:51","date_gmt":"2016-01-10T03:34:51","guid":{"rendered":"https:\/\/2blog.ilc.edu.tw\/25793\/2016\/01\/10\/centos-7-x-%e5%a5%97%e4%bb%b6%e8%87%aa%e5%8b%95%e6%9b%b4%e6%96%b0\/"},"modified":"2016-01-10T11:34:51","modified_gmt":"2016-01-10T03:34:51","slug":"centos-7-x-%e5%a5%97%e4%bb%b6%e8%87%aa%e5%8b%95%e6%9b%b4%e6%96%b0","status":"publish","type":"post","link":"https:\/\/2blog.ilc.edu.tw\/25793\/2016\/01\/10\/centos-7-x-%e5%a5%97%e4%bb%b6%e8%87%aa%e5%8b%95%e6%9b%b4%e6%96%b0\/","title":{"rendered":"CentOS 7.x \u5957\u4ef6\u81ea\u52d5\u66f4\u65b0"},"content":{"rendered":"<p>\u4e00\u822c\u4f86\u8aaa\uff0c\u500b\u4eba\u6bd4\u8f03\u4e0d\u5efa\u8b70\u8b93\u7cfb\u7d71\u81ea\u52d5\u66f4\u65b0\uff0c\u56e0\u70ba\u5728\u7b2c\u4e00\u6642\u9593\u505a\u5957\u4ef6\u66f4\u65b0\uff0c\u6709\u6642\u5019\u6703\u767c\u751f\u96e3\u4ee5\u5fa9\u539f\u7684\u707d\u96e3\uff0c\u6240\u4ee5\u4e00\u822c\u6211\u7684\u505a\u6cd5\u662f\u8b93\u7cfb\u7d71\u53bb\u6aa2\u67e5\u662f\u5426\u6709\u5957\u4ef6\u8981\u505a\u66f4\u65b0\uff0c\u5982\u679c\u6709\u7684\u8a71\uff0c\u5229\u7528 mail \u901a\u77e5\uff0c\u518d\u7531\u7ba1\u7406\u8005\u6c7a\u5b9a\u662f\u5426\u8981\u7acb\u5373\u505a\u66f4\u65b0\u3002<\/p>\n<p>1. \u5b89\u88dd yum-cron \u5957\u4ef6<br \/># <span style=\"color: #ff0000;\">yum install yum-cron<\/span><\/p>\n<p>2. \u5099\u4efd\u8a2d\u5b9a\u6a94<br \/># <span style=\"color: #ff0000;\">cp \/etc\/yum\/yum-cron.conf \/etc\/yum\/yum-cron.conf.$(date +%F)<\/span><br \/># <span style=\"color: #ff0000;\">cp \/etc\/yum\/yum-cron-hourly.conf \/etc\/yum\/yum-cron-hourly.conf.$(date +%F)<\/span>[@more@]3. \u8a2d\u5b9a mail \u901a\u77e5\u7684\u5c0d\u8c61<br \/># <span style=\"color: #ff0000;\">sed -i &#8220;s|^email_to = root|email_to = your@email.com|&#8221; \/etc\/yum\/yum-cron.conf<\/span><\/p>\n<p>4. <span style=\"color: #0000ff;\">\/etc\/yum\/yum-cron.conf<\/span> \u7684\u5176\u5b83\u8a2d\u5b9a<br \/>\u6709\u4e0b\u8f09\u6216\u66f4\u65b0\u5957\u4ef6\u6642\u901a\u77e5\u7ba1\u7406\u8005<br \/># <span style=\"color: #ff0000;\">sed -i &#8216;s|^update_messages = no|update_messages = yes|&#8217; \/etc\/yum\/yum-cron.conf<\/span><br \/>\u662f\u5426\u81ea\u52d5\u4e0b\u8f09\u5957\u4ef6\u7684\u66f4\u65b0\u6a94(\u500b\u4eba\u8a2d\u5b9a <span style=\"color: #0000ff;\">no<\/span>)<br \/># <span style=\"color: #ff0000;\">sed -i &#8216;s|^download_updates = no|download_updates = yes|&#8217; \/etc\/yum\/yum-cron.conf<\/span><br \/>\u662f\u5426\u81ea\u52d5\u5b89\u88dd\u5957\u4ef6\u7684\u66f4\u65b0\u6a94(\u500b\u4eba\u8a2d\u5b9a <span style=\"color: #0000ff;\">no<\/span>)<br \/># <span style=\"color: #ff0000;\">sed -i &#8216;s|^apply_updates = no|apply_updates = yes|&#8217; \/etc\/yum\/yum-cron.conf<\/span><br \/>\u5229\u7528 email \u901a\u77e5\u7ba1\u7406\u8005<br \/># <span style=\"color: #ff0000;\">sed -i &#8216;s|^emit_via = stdio|emit_via = email|&#8217; \/etc\/yum\/yum-cron.conf<\/span><\/p>\n<p>5. <span style=\"color: #0000ff;\">\/etc\/yum\/yum-cron-hourly.conf<\/span> \u7684\u8a2d\u5b9a<br \/># <span style=\"color: #ff0000;\">sed -i &#8220;s|^email_to = root|email_to = your@email.com|&#8221; \/etc\/yum\/yum-cron-hourly.conf<\/span><br \/>\u8a2d\u5b9a\u66f4\u65b0\u7684\u985e\u5225<br \/># <span style=\"color: #ff0000;\">sed -i &#8216;s|^update_cmd = default|update_cmd = security|&#8217; \/etc\/yum\/yum-cron-hourly.conf<\/span><br \/># <span style=\"color: #ff0000;\">sed -i &#8216;s|^update_messages = no|update_messages = yes|&#8217; \/etc\/yum\/yum-cron-hourly.conf<\/span><br \/># <span style=\"color: #ff0000;\">sed -i &#8216;s|^emit_via = stdio|emit_via = email|&#8217; \/etc\/yum\/yum-cron-hourly.conf<\/span><\/p>\n<p>6. \u91cd\u65b0\u555f\u52d5 yum-cron \u670d\u52d9<br \/># <span style=\"color: #ff0000;\">systemctl restart yum-cron.service\u00a0<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e00\u822c\u4f86\u8aaa\uff0c\u500b\u4eba\u6bd4\u8f03\u4e0d\u5efa\u8b70\u8b93\u7cfb\u7d71\u81ea\u52d5\u66f4\u65b0\uff0c\u56e0\u70ba\u5728\u7b2c\u4e00\u6642\u9593\u505a\u5957\u4ef6\u66f4\u65b0\uff0c\u6709\u6642\u5019\u6703\u767c\u751f\u96e3\u4ee5\u5fa9\u539f\u7684\u707d\u96e3\uff0c\u6240\u4ee5\u4e00\u822c\u6211\u7684\u505a\u6cd5 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/2blog.ilc.edu.tw\/25793\/2016\/01\/10\/centos-7-x-%e5%a5%97%e4%bb%b6%e8%87%aa%e5%8b%95%e6%9b%b4%e6%96%b0\/\" class=\"more-link\">\u95b1\u8b80\u5168\u6587<span class=\"screen-reader-text\">\u3008CentOS 7.x \u5957\u4ef6\u81ea\u52d5\u66f4\u65b0\u3009<\/span><\/a><\/p>\n","protected":false},"author":55,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[117,123],"tags":[],"class_list":["post-19120","post","type-post","status-publish","format-standard","hentry","category-c-78462","category-c-78468"],"meta_key":{"_pingme":["1"],"_encloseme":["1"],"lt_post_id":["623396"]},"_links":{"self":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts\/19120"}],"collection":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/users\/55"}],"replies":[{"embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/comments?post=19120"}],"version-history":[{"count":0,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/posts\/19120\/revisions"}],"wp:attachment":[{"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/media?parent=19120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/categories?post=19120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/2blog.ilc.edu.tw\/25793\/wp-json\/wp\/v2\/tags?post=19120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}