ÔõÑùÉèÖÃCentOSϵͳÒÔ°´ÆÚ¸üÐÂÇå¾²²¹¶¡
ÔõÑùÉèÖÃcentosϵͳÒÔ°´ÆÚ¸üÐÂÇå¾²²¹¶¡
Ëæ×ÅÍøÂçÇ徲Σº¦µÄÒ»Ö±ÔöÌí£¬°´ÆÚ¸üвÙ×÷ϵͳµÄÇå¾²²¹¶¡¹ØÓÚ±£»¤Ð§ÀÍÆ÷ºÍÖÕ¶Ë×°±¸µÄÇå¾²ÖÁ¹ØÖ÷Òª¡£±¾ÎĽ«ÏÈÈÝÔõÑùÔÚCentOSϵͳÉÏÉèÖÃ×Ô¶¯°´ÆÚ¸üÐÂÇå¾²²¹¶¡µÄÒªÁ죬²¢ÌṩÏìÓ¦µÄ´úÂëʾÀý¡£
ʹÓÃyum-cron¹¤¾ß
CentOSϵͳÌṩÁËÒ»¸öÃûΪyum-cronµÄ¹¤¾ß£¬¿ÉÒÔ×ÊÖúÎÒÃÇ×Ô¶¯¸üÐÂϵͳµÄÈí¼þ°üºÍÇå¾²²¹¶¡¡£Ê¹ÓÃÒÔÏÂÏÂÁî×°ÖÃyum-cron¹¤¾ß£º
sudo yum install yum-cron
µÇ¼ºó¸´ÖÆ
×°ÖÃÍê³Éºó£¬Ê¹ÓÃÒÔÏÂÏÂÁîÆôÓÃyum-cronЧÀÍ£º
sudo systemctl start yum-cron sudo systemctl enable yum-cron
µÇ¼ºó¸´ÖÆ
ÉèÖÃyum-cronЧÀÍ
yum-cronЧÀ͵ÄÉèÖÃÎļþλÓÚ/etc/yum/yum-cron.conf¡£Ê¹ÓÃÒÔÏÂÏÂÁî±à¼ÉèÖÃÎļþ£º
sudo vi /etc/yum/yum-cron.conf
µÇ¼ºó¸´ÖÆ
ÔÚÉèÖÃÎļþÖУ¬ÎÒÃÇÐèҪƾ֤ÐèÇóÐÞ¸ÄÒÔϼ¸¸ö²ÎÊý£º
apply_updates = yes # ÆôÓÃ×Ô¶¯¸üРupdate_cmd = default # ĬÈÏʹÓÃyumÏÂÁî¾ÙÐиüРrandom_sleep = 360 # Ëæ»úÑÓ³Ùʱ¼ä£¨µ¥Î»ÎªÃ룩
µÇ¼ºó¸´ÖÆ
Íê³ÉÐ޸ĺó£¬ÉúÑIJ¢Í˳öÉèÖÃÎļþ¡£
ÉèÖð´ÆÚ¸üÐÂʱ¼ä
yum-cronЧÀ͵ÄÍýÏëʹÃüÉèÖÃÎļþλÓÚ/etc/cron.daily/0yum-daily.cron¡£ÎÒÃÇ¿ÉÒÔͨ¹ý±à¼¸ÃÎļþÀ´ÉèÖð´ÆÚ¸üÐÂʱ¼ä¡£
ʹÓÃÒÔÏÂÏÂÁî±à¼ÍýÏëʹÃüÉèÖÃÎļþ£º
sudo vi /etc/cron.daily/0yum-daily.cron
µÇ¼ºó¸´ÖÆ
ÔÚÎļþµÄ¿ªÍ·£¬ÎÒÃÇ¿ÉÒÔ¿´µ½ÒÔÏÂÁ½ÐУº
#!/bin/bash exec /usr/bin/yum --security -R 120 -e 0 -d 0 -y update
µÇ¼ºó¸´ÖÆ
ÆäÖÐ-R²ÎÊýÉèÖÃÁËyumÏÂÁîµÄ³¬Ê±Ê±¼ä£¨µ¥Î»Îª·ÖÖÓ£©£¬-e²ÎÊýÌåÏÖÍ˳ö´úÂëΪ0ʱִÐиüвÙ×÷£¬-d²ÎÊýÌåÏÖ½ûÓÃdebugģʽ¡£
ÎÒÃÇ¿ÉÒÔƾ֤ÐèÒªÐÞ¸ÄÕâЩ²ÎÊý£¬²¢ÉèÖÃÊʺÏ×Ô¼ºµÄ°´ÆÚ¸üÐÂʱ¼ä¡£Íê³ÉÐ޸ĺó£¬ÉúÑIJ¢Í˳öÎļþ¡£
ÊÖ¶¯¸üÐÂÇå¾²²¹¶¡
³ýÁË×Ô¶¯°´ÆÚ¸üÐÂÍ⣬ÎÒÃÇ»¹¿ÉÒÔËæʱÊÖ¶¯¸üÐÂÇå¾²²¹¶¡¡£
ʹÓÃÒÔÏÂÏÂÁîÊÖ¶¯¸üÐÂÈí¼þ°üºÍÇå¾²²¹¶¡£º
sudo yum update --security
µÇ¼ºó¸´ÖÆ
¼à¿Ø¸üÐÂÈÕÖ¾
yum-cronЧÀÍ»áÌìÉú¸üÐÂÈÕÖ¾£¬ÎÒÃÇ¿ÉÒÔͨ¹ýÉó²é¸üÐÂÈÕÖ¾À´¼à¿ØϵͳµÄ¸üÐÂÇéÐΡ£
¸üÐÂÈÕ־λÓÚ/var/log/yum.log¡£Ê¹ÓÃÒÔÏÂÏÂÁîÉó²é¸üÐÂÈÕÖ¾£º
sudo less /var/log/yum.log
µÇ¼ºó¸´ÖÆ
ÔÚ¸üÐÂÈÕÖ¾ÖУ¬ÎÒÃÇ¿ÉÒÔÏàʶµ½Ã¿´Î¸üеÄÈí¼þ°üºÍÇå¾²²¹¶¡µÄÏêϸÐÅÏ¢¡£
ÕâÑù£¬ÎÒÃǾÍÍê³ÉÁËÔÚCentOSϵͳÉÏÉèÖÃ×Ô¶¯°´ÆÚ¸üÐÂÇå¾²²¹¶¡µÄ²Ù×÷¡£
×ܽáÆðÀ´£¬°´ÆÚ¸üÐÂÇå¾²²¹¶¡¹ØÓÚά»¤Ð§ÀÍÆ÷ºÍÖÕ¶Ë×°±¸µÄÇå¾²ÖÁ¹ØÖ÷Òª¡£Í¨¹ýʹÓÃyum-cron¹¤¾ß£¬ÎÒÃÇ¿ÉÒÔÀû±ãµØʵÏÖ×Ô¶¯¸üÐµĹ¦Ð§¡£±ðµÄ£¬ÎÒÃÇ»¹¿ÉÒÔËæʱÊÖ¶¯¸üÐÂÇå¾²²¹¶¡£¬²¢Í¨¹ý¼à¿Ø¸üÐÂÈÕÖ¾À´ÏàʶϵͳµÄ¸üÐÂÇéÐΡ£
Ï£Íû±¾ÎÄÌṩµÄÒªÁì¶ÔÄúÔÚCentOSϵͳÖÐÉèÖð´ÆÚ¸üÐÂÇå¾²²¹¶¡ÓÐËù×ÊÖú£¡
²Î¿¼×ÊÁÏ£º
https://access.redhat.com/solutions/10021
ÒÔÉϾÍÊÇÔõÑùÉèÖÃCentOSϵͳÒÔ°´ÆÚ¸üÐÂÇå¾²²¹¶¡µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡