You are not logged in.

#1 2013-04-15 12:45:11

cdown
Member
From: London, England
Registered: 2013-02-09
Posts: 55
Website

checkupdates-cron: Tiny wrapper around checkupdates for cronjobs

I have my servers set up to e-mail me from cron when updates are available. I used to use a custom script to do this, until recently (Pacman 4.1?) I discovered that a script named "checkupdates" was packaged with pacman, and did the same job.

So, for the past few weeks I've simply been running checkupdates every half hour on a cron job, and getting e-mails. This is usually fine, but sometimes I am not able to update immediately, and keep on getting e-mails every half an hour until I update, which is irritating.

In the script I used before checkupdates, it tested the output, and it would only send an e-mail if it was different to the last run. This meant that I only got e-mails when more updates are available, too.

I figured why not combine the two, and just write a tiny wrapper around checkupdates for use in cron jobs. All it does is check if the result was different to last time before printing anything out, saving you from getting e-mails continuously.

Hopefully someone else will find this useful. :-)

GitHub: https://github.com/cdown/checkupdates-cron
AUR: https://aur.archlinux.org/packages/chec … -cron-git/

Offline

Board footer

Powered by FluxBB