Monitoring / NGINX

Nginx Amplify Automatic Updates on CentOS/RHEL 7

by , , revisited on

We have by far the largest RPM repository with dynamic stable NGINX modules and VMODs for Varnish 4.1 and 6.0 LTS. If you want to install NGINX, Varnish, and lots of useful modules for them, this is your one-stop repository to get all performance-related software.
You have to maintain an active subscription in order to be able to use the repository!

It is recommended to continuously update Nginx Amplify agent. As we want to ease our lives, how can we setup automatic updates for the Amplify agent? I will share how I do it on my servers in this short note.


First, I have looked into leveraging yum-cron for the job. However, I do not want to risk updating everything just for Amplify agent. The yum-cron script, unfortunately, lacks any ways to specify the packages you want to be automatically updated.

So after giving it a thought, I came to an easy and simple solution of “why not” series.

Trivial solution

We can create a simple cron job to auto-update only Nginx Amplify.

Login as root user on your system and type:

crontab -e 

Now simply paste in the following line:

@daily /usr/bin/yum --assumeyes --quiet --errorlevel=0 update nginx-amplify-agent 2>&1

That’s it. Your Amplify agent has been set up to update automatically.
Some insight on the flags in use for the yum:

  • --assumeyes will accept updates for you. FYI: I know I can keep things short by using -y instead, but I always prefer a longer option so I can easily tell what each option does. Readability!
  • --quiet will suppress most of the standard output
  • --errorlevel=0 will output critical errors. As per yum documentation, this is recommended for cron use
  • 2>&1 will ensure that errors are sent to stdout (cron will use that for emailing)

So now you have it. Nginx Amplify will automatically and silently update for you. Provided that you have set up your system properly, you will get an email alert, should any problem occur during automatic update.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.