#!/bin/bash

# make a log with a timestamp when an rpm is installed
# The logfile /var/log/rpminstalls will contain lines like
# <date> <name-version-release>

rpm --queryformat "%{INSTALLTIME} %{NAME}-%{VERSION}-%{RELEASE}\n" -qa | sort -r -n | perl -nwe '/(.*?) (.*)/; if ($1 > (time() - 24*60*60)) {print localtime($1) . " $2\n";}' >> /var/log/rpminstalls
