yum-cron

Red Hat Enterprise Linux 7 (RHEL 7) provides a package for automated updates called yum-cron. Here are some notes on this functionality.

  • NOTE in RHEL 7, the old “vixie-cron” has been replaced by the modern Red Hat fork “cronie” which is a drop-in replacement crond package.
  • rpm -ql yum-cron to list files installed with the package
  • systemctl status yum-cron to see if the automated jobs are enabled. Use sytemctl enable yum-cron to enable at boot, and systemctl start yum-cron to start at runtime. Use disable/stop for the opposite. Start/Stop use the empty flag file /var/lock/subsys/yum-cron to enable or disable the hourly and daily jobs.
  • /etc/cron.daily/0yum-daily.cron and /etc/cron.hourly/0yum-hourly.cron are installed to run on schedule
  • /etc/yum/yum-cron-hourly.conf and /etc/yum/yum-cron.conf are used to configure these scheduled tasks
  • the cron.hourly jobs are run directly by crond (cronie package) as configured in /etc/cron.d/0hourly
  • the cron.daily jobs are run indirectly by the hourly job /etc/cron.hourly/0anacron (cronie-anacron package) which in turn runs all daily tasks.

If the provided hourly/daily schedule doesn’t meet your needs, you can schedule yum-cron directly and provide a modified copy of the config file for your custom job. See the 0yum-hourly.cron file for an example of providing your own yum-cron config. Some useful settings for yum-cron.conf follow.

  • download_updates # set to yes to enable auto-download
    • download_udates is required if using apply_updates
  • apply_updates # set to yes to enable auto-updates
  • random_sleep # set to 0 to run immediately as scheduled by cron
  • emit_via # set to stdio to allow cron to collect and send the output
Advertisements

About notesbytom

Keeping technology notes on WordPress.com to free up my mind to solve new problems rather than figuring out the same ones repeatedly :-).
This entry was posted in Linux and tagged , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s