Auto Update CentOS Server With yum Command

by admin on November 23, 2010

The yum command is used to install and update software under Centos, RedHat and Fedora. In this topic, i will use yum command to update Centos and configure yum to update automatically with Crontab.

Create file yum_update.sh

vi /etc/cron.daily/yum_update.sh

With following content :

#!/bin/bash

/usr/bin/yum -y -R 120 -d 0 -e 0 update yum

/usr/bin/yum -y -R 10 -e 0 -d 0 update

-e 0 -d 0 are to only show critical errors.
-R adds random delay between command execution.

Make it executable

chmod 755 /etc/cron.daily/yum_update.sh

Related Posts:

Leave a Comment

Previous post:

Next post: