Tuesday, September 4, 2018

Configure Automatic Update on Amazon EC2 Server

While deploying EC2 server, one of the features tech operation stuff want is auto updates. We can configure such services in EC2 virtual server.

First install yum-cron using the command below:

sudo yum install yum-cron

Next, we need to configure the conf file. Use the following command to open the config file: 

sudo nano /etc/yum/yum-cron.conf

The configuration sample are as follows: 

# configure to apply type of update, apply update, email
update_cmd = default
update_messages = yes
download_updates = yes
apply_updates = yes
random_sleep = 120
emit_via = email
email_from = root@localhost
email_to = emailladdress@domain.com
email_host = localhost


To start yum-cron and configure the service to start when system reboots using the following command:

sudo systemctl start yum-cron.service
sudo systemctl enable yum-cron.servic

For older system, we might need to use the following command:

sudo service yum-cron start
sudo chkconfig yum-cron on


***








No comments:

Post a Comment

Note: Only a member of this blog may post a comment.