You are not logged in.
I would like to have a bash script that can run on various Arch devices and return the duration (such as number of minutes, hours, days, etc.) since the last full system upgrade was performed with pacman. (Or maybe just the last update of any type.)
I cannot rely upon file dates in /var/cache/pacman because that points to a shared resource.
The only idea I have so far is to parse the date from the value returned by `uname -a` but I suspect there's a much better option. Can anyone suggest one?
Offline
Like
grep 'starting full system upgrade' /var/log/pacman.log | tail -1
?
Offline
Like
grep 'starting full system upgrade' /var/log/pacman.log | tail -1
?
Yes, exactly like that. Thank you.
Offline
The information you need will be in /var/log/pacman.log. You will need to do some processing on it.
A really crude example might be
grep Syu /var/log/pacman.log | tail -1
Edit: Wow. Was I slow.
Last edited by ewaller (2021-08-03 14:18:43)
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way
Offline