How do I set up my centos instances to automatically apply security updates?
Is it as simple as setting up a cron job that does yum -y update at 1:00am ?
How do I set up my centos instances to automatically apply security updates?
Is it as simple as setting up a cron job that does yum -y update at 1:00am ?
This is done with yum-cron
. It includes a cron job at /etc/cron.daily/yum.cron
which only runs if the yum
service (CentOS 5 'extras' repo) or yum-cron
service (CentOS 6 'base' repo) is activated:
CentOS 5:
# yum install yum-cron
# chkconfig --level 345 yum on
# service yum start
CentOS 6:
# yum install yum-cron
# chkconfig --level 345 yum-cron on
# service yum-cron start
I have done research about how to update redhat/centos automatically, most of them recommend installing yum-cron, but for me, I have tried to just put a cronjob in /etc/crontab
. This config has done the job for me for a couple of months for many servers, without a single hiccup
0 1 * * sun root yum -y update
I also set up an email alias so that when the cron mails root@localhost, this mail is forwarded to my personal work email. This way I know exactly which packages was updated in our systems
For the kernel update, its risky so its better to do it manually :)