CentOS7のサポートは終わっているが、zabbixやwebminのアップデートは続くため、アップデートの自動適用を今更ながら設定
# yum install yum-cron Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * epel: d2lzkl7pfhq30w.cloudfront.net Resolving Dependencies --> Running transaction check ---> Package yum-cron.noarch 0:3.4.3-168.el7.centos will be installed --> Finished Dependency Resolution Dependencies Resolved ================================================================================ Package Arch Version Repository Size ================================================================================ Installing: yum-cron noarch 3.4.3-168.el7.centos base 66 k Transaction Summary ================================================================================ Install 1 Package Total download size: 66 k Installed size: 51 k Is this ok [y/d/N]: y Downloading packages: yum-cron-3.4.3-168.el7.centos.noarch.rpm | 66 kB 00:00 Running transaction check Running transaction test Transaction test succeeded Running transaction Warning: RPMDB altered outside of yum. Installing : yum-cron-3.4.3-168.el7.centos.noarch 1/1 Verifying : yum-cron-3.4.3-168.el7.centos.noarch 1/1 Installed: yum-cron.noarch 0:3.4.3-168.el7.centos Complete!
# cd /etc/yum # cp -p yum-cron.conf yum-cron.conf.org # vi yum-cron.conf apply_updates = yes emit_via = email # systemctl enable yum-cron # systemctl start yum-cron # systemctl status yum-cron ● yum-cron.service - Run automatic yum updates as a cron job Loaded: loaded (/usr/lib/systemd/system/yum-cron.service; enabled; vendor preset: disabled) Active: active (exited) since Mon 2025-12-08 00:13:34 JST; 3s ago Process: 24640 ExecStart=/bin/touch /var/lock/subsys/yum-cron (code=exited, status=0/SUCCESS) Main PID: 24640 (code=exited, status=0/SUCCESS) Dec 08 00:13:34 i-15100000220639 systemd[1]: Starting Run automatic yum upda.... Dec 08 00:13:34 i-15100000220639 systemd[1]: Started Run automatic yum updat.... Hint: Some lines were ellipsized, use -l to show in full.
インストール後はdailyでスケジュールされる
cat /etc/cron.daily/0yum-daily.cron #!/bin/bash # Only run if this flag is set. The flag is created by the yum-cron init # script when the service is started -- this allows one to use chkconfig and # the standard "service stop|start" commands to enable or disable yum-cron. if [[ ! -f /var/lock/subsys/yum-cron ]]; then exit 0 fi # Action! exec /usr/sbin/yum-cron
cat /var/log/cron Dec 8 05:48:17 xxxxxx run-parts(/etc/cron.daily)[3439]: finished 0yum-daily.cron
