1

I see that unattended-upgrades issues shutdown -r command with the scheduled time. However, the PC is sleeping at that time. It also doesn't restart after manual wakeup. This is for a computer novice user (grandma), she most certainly forgets to restart it every week or so. And i don't want to restart it immediately to avoid interrupting her work, so decided to do it in the middle of the night.

UPDATE: Grandma wakes the PC from sleep with some random button, most certainly the power button.

1 Answer 1

1

"Reboot required" is indicated by the existence of the files /var/run/reboot*.

You could create a root cron job (note: root's crontab is a different format, read man 5 crontab), to run at 4AM and do something like:

#!/bin/bash
zz="$(find /var/run -type f -name 'reboot*')"
[[ -n "$zz" ]] && shutdown -r +10 
3
  • Thank you for the reply! Is this going to work even if the PC is sleeping at 4AM?
    – Lyubomir
    Nov 14, 2020 at 22:17
  • 1
    No. When a PC is sleeping/suspended/hibernating, nothing takes place, no programs are run. If, however, you mean "screen locked", it will run. How does grandma begin "work" in the morning? Power button or mouse move?
    – waltinator
    Nov 15, 2020 at 4:04
  • Added info to question.
    – Lyubomir
    Nov 15, 2020 at 8:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.