Comments on Reducing Noise from yum-cron when repos are out of date
Post
Reducing Noise from yum-cron when repos are out of date
I have a few CentOS servers that I want to stay automatically up to date with yum-cron, and I want to get emails when there are problems but I do not want to get so many emails about repos being out of date.
Basically, the repos are run by volunteers and sometimes their index files fall behind. Yum picks one at random when it runs, and if it gets an old one, then yum-cron throws an error. Cron faithfully emits this error to the local mailer which sends it to me like the example below:
From: "(Cron Daemon)" <root@example.com>
To: root@example.com
Subject: Cron <root@example> run-parts /etc/cron.hourly
Content-Type: text/plain; charset=UTF-8
Auto-Submitted: auto-generated
Precedence: bulk
X-Cron-Env: <XDG_SESSION_ID=235865>
X-Cron-Env: <XDG_RUNTIME_DIR=/run/user/0>
X-Cron-Env: <LANG=en_US.UTF-8>
X-Cron-Env: <SHELL=/bin/bash>
X-Cron-Env: <PATH=/sbin:/bin:/usr/sbin:/usr/bin>
X-Cron-Env: <MAILTO=root>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <LOGNAME=root>
X-Cron-Env: <USER=root>
Message-Id: <20220215200809.6D07E413EF@mdomain.com>
Date: Tue, 15 Feb 2022 14:08:09 -0600 (CST)
/etc/cron.hourly/0yum-hourly.cron:
Not using downloaded updates/repomd.xml because it is older than what we have:
Current : Mon Feb 14 13:39:31 2022
Downloaded: Tue Feb 8 14:02:02 2022
The most ideal resolution I think, would be able to set a threshold of how many days old I want to ignore. i.e. I could put in 14 and as long as a repo was no more than 2 weeks old it wouldn't bother me about it.
But I'm 100% sure there's no setting anywhere for that.
I thought maybe adding a yum clean all to the yum-cron script might help if it makes my local yum db unaware of the latest change, so it would recognize all repos as new but that seems a little crude.
I'd also be fine just not hearing about out of date repos at all. So maybe I add a filter to gmail to match "/etc/cron.hourly/0yum-hourly.cron" "Not using downloaded" "because it is older than what we" and call it a day. Anyone have a better suggestion?
2 comment threads