yum -y install yum-cron
systemctl enable yum-cron.service
systemctl start yum-cron.service
systemctl status yum-cron.service
vim /etc/yum/yum-cron.conf
vim /etc/yum/yum-cron-hourly.conf
download_updates = yes
apply_updates = yes
systemctl restart yum-cron.service
#exclude=kernel*
#exclude=java*
自动执行
yum -y install yum-cron
mv /etc/yum/yum-cron.conf /etc/yum/yum-cron.conf.old
mv /etc/yum/yum-cron-hourly.conf /etc/yum/yum-cron-hourly.conf.old
wget -P /etc/yum http://download.xxx.xxx/linux/etc/yum/yum-cron.conf
wget -P /etc/yum http://download.xxx.xxx/linux/etc/yum/yum-cron-hourly.conf
systemctl enable yum-cron.service
systemctl start yum-cron.service
Centos8自动更新
dnf -y install dnf-automatic
vim /etc/dnf/automatic.conf
download_updates = yes
apply_updates = yes
systemctl enable --now dnf-automatic.timer