Auto update Observium with crontab

Therefore that Observium doesn't use APT for updating, it can't be upgraded with unattended-upgrades for example. Nevertheless Observium can automatically be upgraded with a crontab:

This way of updating was only tested for the enterprise version of Observium!

Create a crontab file with the following content:

/etc/cron.d/observium-update

# run observium update once a week
MAILTO=<mail-address>
0 6    * * 7   root /bin/bash /opt/observium-update

And create the following file:

/opt/observium-update

#!/usr/bin/bash
echo ""
echo "» Updating  Observium to latest version «"
echo ""
echo ""
/usr/bin/svn update /opt/observium --non-interactive --no-auth-cache --username <username> --password <password>
 
echo ""
echo "» Update finished «"
echo ""
 
# touch this file to leave a fingerprint, if mailing fails
touch /root/updated.txt

In case that your system has a proper configured mailutils-package, the output of the crontab will be sent to the configured mail address at MAILTO=. Usually one script in /etc/cron.weekly would be enough, but we discovered, that the setting of MAILTO is ignored then and mailing will go always to root.

  • monitoring/observium/auto-update.txt
  • Last modified: 2025/02/22 15:22
  • by Zyzonix