Auto update CentOS server with yum

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

Leave a Reply