If you are on RHEL make sure optional repos are enabled:
subscription-manager repos --enable rhel-7-server-optional-rpms
Then install yum-cron:
yum -y install yum-cron
Enable yum-cron:
systemctl enable yum-cron.service
Edit yum cron config:
vim /etc/yum/yum-cron.conf
make sure apply_updates
is set to yes
:
# Whether updates should be applied when they are available. Note
# that download_updates must also be yes for the update to be applied.
apply_updates = yes
Start the service:
systemctl start yum-cron.service
Check status of the service, make sure it’s up:
systemctl status yum-cron.service
active (exited) is the desired value.
Monitor the log files using:
tail -f /var/log/yum.log
and
tail -f /var/log/cron
Or using multitail (yum install multitail)
multitail -f /var/log/cron /var/log/yum.log