Date: Sat, 18 Feb 2023 21:56:42 +0000 From: void <void@f-m.fm> To: freebsd-hackers@freebsd.org Subject: Re: avoiding periodic(8) during long poudriere runs Message-ID: <Y/FJmq6Zx0Rgphdx@int21h> In-Reply-To: <c64dd767-298d-c3a7-0cf6-cd7b8a58a656@quip.cz> References: <Y/EE%2BWabwqiLifBx@int21h> <c64dd767-298d-c3a7-0cf6-cd7b8a58a656@quip.cz>
index | next in thread | previous in thread | raw e-mail
On Sat, Feb 18, 2023 at 09:46:43PM +0100, Miroslav Lachman wrote:
>I don't know about any generic way, but you can put some shell code into
>/etc/periodic.conf to exit if load is too high
>
>Just a quick and dirty example, exit if 5 minutes avg is higher than 1.1:
>
>avg5load=$(top | awk '/load averages:/ { load=$7+0; if (load > 1.1) {
>print "HIGH" } }')
>echo $avg5load
>if [ "$avg5load" = "HIGH" ]; then
> echo "CPU load is too high"
> exit 5
>fi
Many thanks for this. I didn't know one could put scripting into periodic.conf!
--
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Y/FJmq6Zx0Rgphdx>
