I have configured unattended-upgrades to run automatically on an Ubuntu Server 18.04. This is working as intended.
How can I check the result of the last unattended-upgrades run through a bash script? In particular, I want to detect if downloading update repository lists or downloading or installing any updated package has failed, for whatever reason. I don't need access to error messages, a single boolean flag whether the unattended upgrade succeeded or failed is sufficient. This information will later be used to indicate whether human interaction is required.
Clarification: I do not want to access the current unattended upgrades status, I want to access the result (success/failure) of the last time unattended upgrades ran.
$ less /var/log/unattended-upgrades/unattended-upgrades.log
update-success-stamp
, which is written by other apt invocations as well (not only u.u.) and only covers successful renewal of the repo lists, not upgraded packages. There is no stamp for the successful completion of u.u. If parsing the log file is an option, the referenced answer does not conclude which conditions must be checked to infer successful or erronous u.u. completion