리눅스 CentOS 6 ,7 , RedHat 6,7 에서 yum -y install yum-cron 으로 항상 최신업데이트 하는 방법

리눅스 CentOS 6 ,7 , RedHat 6,7 에서 yum -y install yum-cron 으로 항상 최신업데이트 하는 방법






Centos 6 and RHEL 6 순서 정리

# yum -y install yum-cron    <-- 해당 패키지 설치하는 명령어

# vi /etc/sysconfig/yum-cron    <-- 설정에서 옵션 변경 가능
MAILTO=test@andwise.com    <--   관련사항 메일로 통보 받게 설정한다.


# /etc/init.d/yum-cron start   <-- 해당 서비스 실행한다.
# chkconfig yum-cron on     <--  리부팅 시에도 자동시작되게 서비스에 등록한다.



Centos 7 and RHEL 7 순서 정리

#yum -y install yum-cron

#vi /etc/yum/yum-cron.conf


# /bin/systemctl status  yum-cron.service

# systemctl start yum-cron.service








리눅스에서 # yum -y update  명령어로 간단하게 업데이트가 가능합니다.

[root@ init.d]# yum -y update
Loaded plugins: fastestmirror
Setting up Update Process
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository contrib is listed more than once in the configuration
Loading mirror speeds from cached hostfile
 * base: ftp.tsukuba.wide.ad.jp
 * extras: data.nicehosting.co.kr
 * updates: ftp.tsukuba.wide.ad.jp
No Packages marked for Update
[root@ init.d]#

그러나 주기적으로 업데이트를 자동으로 하기위해서는 별도의 과정이 필요합니다.
crontab 이란 작업스케쥴로 설정해도 되지만 별도의 yum-cron 이란 좋은 패키지가 있습니다.


참고 주소 :

Centos 6 and RHEL 6

Centos 7 and RHEL 7





설치 및 설정 수정해본 모습
[root@ltm6-demo init.d]# yum -y install yum-cron    <-- 해당 패키지 설치하는 명령어
Loaded plugins: fastestmirror
Setting up Install Process
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Repository contrib is listed more than once in the configuration
Loading mirror speeds from cached hostfile
 * base: ftp.tsukuba.wide.ad.jp
 * extras: data.nicehosting.co.kr
 * updates: ftp.tsukuba.wide.ad.jp
Resolving Dependencies
--> Running transaction check
---> Package yum-cron.noarch 0:3.2.29-81.el6.centos will be installed
--> Finished Dependency Resolution

Dependencies Resolved

============================================================================================================================================
 Package                        Arch                         Version                                       Repository                  Size
============================================================================================================================================
Installing:
 yum-cron                       noarch                       3.2.29-81.el6.centos                          base                        46 k

Transaction Summary
============================================================================================================================================
Install       1 Package(s)

Total download size: 46 k
Installed size: 28 k
Downloading Packages:
yum-cron-3.2.29-81.el6.centos.noarch.rpm                                                                             |  46 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : yum-cron-3.2.29-81.el6.centos.noarch                                                                                     1/1
  Verifying  : yum-cron-3.2.29-81.el6.centos.noarch                                                                                     1/1

Installed:
  yum-cron.noarch 0:3.2.29-81.el6.centos                                                                                                   

Complete!
[root@ltm6-demo init.d]# vi /etc/sysconfig/yum-cron    <-- 설정에서 옵션 변경 가능
# Pass any given paramter to yum, as run in all the scripts invoked
# by this package.  Be aware that this is global, and yum is invoked in
# several modes by these scripts for which your own parameter might not
# be appropriate
YUM_PARAMETER=

# Don't install, just check (valid: yes|no)
CHECK_ONLY=no    <-- 체크만하는 옵션으로 노로 설치하게 한다.

# Check to see if you can reach the repos before updating (valid: yes|no)
CHECK_FIRST=no

# Don't install, just check and download (valid: yes|no)
# Implies CHECK_ONLY=yes (gotta check first to see what to download)
DOWNLOAD_ONLY=no   <-- 해당 최신 패키지 다운로드하게 한다.

# Error level, practical range 0-10, 0 means print only critical errors which
# you must be told, 1 means print all errors, even ones that are not important
# Level 0 is the default
# ERROR_LEVEL=0

# Debug level, practical range 0-10, higher number means more output
# Level 1 is a useful level if you want to see what's been done and
# don't want to read /var/log/yum.log
# Level 0 is the default
# DEBUG_LEVEL=1

# randomwait is used by yum to wait random time
# default is 60 so yum waits random time from 1 to 60 minutes
# the value must not be zero
RANDOMWAIT="60"

# if MAILTO is set and the mail command is available, the mail command
# is used to deliver yum output

# by default MAILTO is unset, so crond mails the output by itself
# example:  MAILTO=root
MAILTO=test@andwise.com    <--   관련사항 메일로 통보 받게 설정한다.

# you may set SYSTEMNAME if you want your yum emails tagged differently
# default is output of hostname command
# this variable is used only if MAILTO is set too
#SYSTEMNAME="tm6_demo"

# you may set DAYS_OF_WEEK to the days of the week you want to run
# default is every day
#DAYS_OF_WEEK="0123456"

# which day should it do cleanup on?  defaults to 0 (Sunday).  If this day isn't in the
# DAYS_OF_WEEK above, it'll never happen
CLEANDAY="0"

# set to yes to make the yum-cron service to wait for transactions to complete
SERVICE_WAITS=yes

# set maximum time period (in seconds) for the yum-cron service to wait for
# transactions to complete.  The default is 300 seconds (5 minutes)
SERVICE_WAIT_TIME=300
"/etc/sysconfig/yum-cron" 58L, 2044C written
[root@ltm6-demo init.d]#
[root@ltm6-demo init.d]#
[root@ltm6-demo init.d]#
[root@ltm6-demo init.d]# /etc/init.d/yum-cron start   <-- 해당 서비스 실행한다.
Enabling nightly yum update: [  OK  ]
[root@ltm6-demo init.d]# chkconfig yum-cron on     <--  리부팅 시에도 자동시작되게 서비스에 등록한다.



















안녕하세요. 썬더메일입니다. 영업문의: 070-7095-9792 , 기술문의: 070-7095-9794 , 메일문의처
지원 서비스: 대량ㆍ자동메일(API포함), 대량ㆍ자동SMS, 카카오톡 알림톡, 설문조사(와이즈서베이)

댓글