ÔÚ Linux ϵͳÉÏ£¬ÆäÖÐÒ»¸ö×îÖØÒªµÄÐèÇó¾ÍÊDZ£³Ö¶¨ÆÚ¸üÐÂ×îÐµİ²È«²¹¶¡£¬»òÕßΪÏàÓ¦µÄ Linux °æ±¾¸üпÉÓõݲȫ²¹¶¡¡£ÔÚÕâƪÎÄÕÂÖУ¬ÎÒÃǽ«·ÖÏíÈçºÎÔÚ CentOS/RHEL 7/6 °æ±¾ÖÐÉèÖÃÔÚÐèҪʱ×Ô¶¯¸üÐÂÖØÒªµÄ°²È«²¹¶¡¡£ºÍËüͬһ¼Ò×åµÄÆäËü Linux °æ±¾£¨Fedora »ò Scientific Linux£©ÖпÉÒÔÓÃÀàËƵķ½·¨½øÐÐÅäÖᣠ|
ÔÚ CentOS/RHEL 7/6 ϵͳÉÏ£¬ÄãÐèÒª°²×°ÏÂÃæµÄ°²×°°ü£º
# yum update -y ; yum install yum-cron -y
°²×°Íê³ÉÒԺ󣬴ò¿ª/etc/yum/yum-cron.conf£¬È»ºóÕÒµ½ÏÂÃæÕâЩÐÐÄÚÈÝ£¬Äã±ØÐëÈ·±£ËüÃǵÄÖµºÍÏÂÃæչʾµÄÒ»Ñù
update_messages = yes download_updates = yes apply_updates = yes
µÚÒ»ÐбíÃ÷×Ô¶¯¸üÐÂÃüÁîÐÐÓ¦¸ÃÏñÕâÑù£º
# yum --security upgrade
¶øÆäËüµÄÐб£Ö¤ÁËÄܹ»Í¨Öª²¢×Ô¶¯ÏÂÔØ¡¢°²×°°²È«Éý¼¶¡£
ΪÁËʹÀ´×Ô root@localhost µÄ֪ͨÄܹ»Í¨¹ýÓʼþ·¢Ë͸øͬһÕË»§£¨ÔÙ´Î˵Ã÷£¬Äã¿ÉÒÔÑ¡ÔñÆäËûÕË»§£¬Èç¹ûÄãÏëÕâÑùµÄ»°£©£¬ÏÂÃæÕâЩÐÐÒ²ÊDZØÐëµÄ¡£
emit_via = email email_from = root@localhost email_to = root
ĬÈÏÇé¿öÏ£¬ cron ÈÎÎñ±»ÅäÖóÉÁËÁ¢¼´ÏÂÔز¢°²×°ËùÓиüУ¬µ«ÊÇÎÒÃÇ¿ÉÒÔͨ¹ýÔÚ /etc/sysconfig/yum-cron ÅäÖÃÎļþÖаÑÏÂÃæÁ½¸ö²ÎÊý¸ÄΪyes£¬´Ó¶ø¸Ä±äÕâÖÖÐÐΪ¡£
# ²»Òª°²×°£¬Ö»×ö¼ì²é£¨ÓÐЧֵ£º yes|no£© CHECK_ONLY=yes # ²»Òª°²×°£¬Ö»×ö¼ì²éºÍÏÂÔØ£¨ÓÐЧֵ£º yes|no£© # ÒªÇó CHECK_ONLY=yes£¨ÏÈÒª¼ì²éºó²Å¿ÉÒÔÖªµÀÒªÏÂÔØʲô£© DOWNLOAD_ONLY=yes
ΪÁËÆôÓùØÓÚ°²×°°ü¸üеÄÓʼþ֪ͨ£¬ÄãÐèÒª°ÑMAILTO ²ÎÊýÉèÖÃΪһ¸öÓÐЧµÄÓʼþµØÖ·¡£
# ĬÈÏÇé¿öÏ MAILTO ÊÇûÓÐÉèÖõģ¬crond »á½«Êä³ö·¢ËÍÓʼþ¸ø×Ô¼º # £¨Ö´ÐÐ cron µÄÓû§£¬ÕâÀïÊÇ root£© # Àý×Ó£º MAILTO=root MAILTO=admin@tecmint.com
×îºó£¬´ò¿ª²¢ÆôÓÃyum-cron ·þÎñ£º
------------- On CentOS/RHEL 7 ------------- systemctl start yum-cron systemctl enable yum-cron ------------- On CentOS/RHEL 6 ------------- # service yum-cron start # chkconfig --level 35 yum-cron on
¹§Ï²Ä㣬ÄãÒѾ³É¹¦µÄÔÚ CentOS/RHEL 7/6 ϵͳÉÏÉèÖÃÁË×Ô¶¯Éý¼¶¡£
ÔÚÕâƪÎÄÕÂÖУ¬ÎÒÃÇÌÖÂÛÁËÈçºÎ±£³ÖÄãµÄ·þÎñÆ÷¶¨ÆÚ¸üлòÉý¼¶×îÐµİ²È«²¹¶¡¡£ÁíÍ⣬ΪÁ˱£Ö¤µ±ÐµIJ¹¶¡±»Ó¦ÓÃʱÄã×Ô¼ºÄܹ»ÖªµÀ£¬ÄãҲѧϰÁËÈçºÎÅäÖÃÓʼþ֪ͨ¡£
ÔÎĵØÖ·£ºhttp://www.linuxprobe.com/centos-rhel-update.html±à¼Ô±£ºÁõ·å£¬ÉóºËÔ±£ºåÌÔö±¦