You are not logged in.

#1 2015-06-29 07:25:04

Debasish Patra
Member
Registered: 2014-03-06
Posts: 64

Check last time I upgraded

Hi,
Is there any way to know when I last upgraded my system ?

Thanks Debasish

Last edited by Debasish Patra (2015-06-29 07:25:26)


Keep Calm, And Enjoy Life smile

Offline

#2 2015-06-29 07:29:34

mauritiusdadd
Member
From: Benevento, Italy
Registered: 2013-10-27
Posts: 776

Re: Check last time I upgraded

look at the file /var/log/pacman.log. You can also use the following command:

awk '/full system upgrade/ { save=$0 }END{ print save }' /var/log/pacman.log

--edit: or better, to show only the date and time

awk '/full system upgrade/ { dt=$1; tm=$2 } END { print dt,tm }' /var/log/pacman.log 

Last edited by mauritiusdadd (2015-06-29 07:38:04)


About me - github

-- When you have eliminated the impossible, whatever remains, however improbable, must be the truth -- Spock | Sherlock Holmes

Offline

#3 2015-06-29 07:30:52

GloW_on_dub
Member
Registered: 2013-03-13
Posts: 388

Re: Check last time I upgraded

Check /var/log/pacman.log

You can also know it package by package by doing :

pacman -Qi package

Last edited by GloW_on_dub (2015-06-29 07:31:14)

Offline

#4 2015-06-29 13:36:42

cirrus
Member
From: Glasgow Scotland
Registered: 2012-08-24
Posts: 340
Website

Re: Check last time I upgraded

Op may find this small shell script of use ..  edit to suit

#!/bin/bash
export DISPLAY=":0.0"
LASTUPD="$(echo -e "Pacman Last Upgraded: " ; cat /var/log/pacman.log | grep upgraded | head -n 1 | cut -c 2-17)"
  
  notify-send -i ~/.icons/pacman3.png  "$LASTUPD" 

exit

Last edited by cirrus (2015-06-29 15:17:05)

Offline

#5 2015-06-29 15:30:11

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,885
Website

Re: Check last time I upgraded

I don't think that does what you think it does, cirrus. At the very least you probably want to switch out 'head' for 'tail'.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#6 2015-06-29 15:33:01

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,544
Website

Re: Check last time I upgraded

Wormzy, it seems to work ... but...

grep + head + cut = awk.

cat + grep + head + cut = stupid.

echo + cat + grep + head + cut = stupid and confusing.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

#7 2015-06-29 15:45:13

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,885
Website

Re: Check last time I upgraded

Oh, absolutely. As mauritiusdadd's post demonstrates, awk is the way to go.

I was just pointing out to cirrus that their script shows the time of the first package upgrade. At the very least they should use tail, but they'd be better off throwing out the entire pipeline and using awk instead.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#8 2015-06-29 15:45:20

Alad
Wiki Admin/IRC Op
From: Bagelstan
Registered: 2014-05-04
Posts: 2,413
Website

Re: Check last time I upgraded

Also why does it hardcode DISPLAY when you can simply run the script within X? hmm


Mods are just community members who have the occasionally necessary option to move threads around and edit posts. -- Trilby

Offline

#9 2015-06-29 16:36:08

cirrus
Member
From: Glasgow Scotland
Registered: 2012-08-24
Posts: 340
Website

Re: Check last time I upgraded

Thanks for the pointers guy's @Alad it shows DISPLAY coz i have it as a 6 hour cronjob on the rpi which has no X.

Offline

Board footer

Powered by FluxBB