Skip Navigation
Determining the efficacy of a restart from a bash script (Debian)

I should preface this by stating I am a novice in general when it comes to the linux world.

I'm trying to write a bash script that will run on an ordinary basis as a cron job. It's simple enough it just runs apt update -y apt upgrade -y apt autoclean every 24 hours. The issue is that I also would like to be able to schedule a restart automatically if a restart would be frugal. I don't really want to just rely on checking for /var/run/reboot-required, and the output from debian-goodies checkrestart seems to be pretty dated and incompatible with scripts in general. Would it be better to run systemctl status and check for degradation, and then schedule a restart based on that? Does anyone far smarter than me have a solution?

3
Yeah
0
Sunnyposting

Free Yung Thug 🗣👏

0
InitialsDiceBearhttps://github.com/dicebear/dicebearhttps://creativecommons.org/publicdomain/zero/1.0/„Initials” (https://github.com/dicebear/dicebear) by „DiceBear”, licensed under „CC0 1.0” (https://creativecommons.org/publicdomain/zero/1.0/)EL
ellypony @lemmy.world
Posts 10
Comments 10