From: Iain Patterson Date: Mon, 27 Jan 2014 14:31:17 +0000 (+0000) Subject: Script to guess Red Hat machine's build date. X-Git-Url: http://git.iain.cx/?a=commitdiff_plain;h=08392e37a0280a6943b36d0b857f916cd650a3d5;p=profile.git Script to guess Red Hat machine's build date. Querying RPM for the installation date of the basesystem package should provide a decent approximation of the date the machine was (re)built. --- diff --git a/opt/Linux/bin/redhat_build_date b/opt/Linux/bin/redhat_build_date new file mode 100755 index 0000000..aa234b4 --- /dev/null +++ b/opt/Linux/bin/redhat_build_date @@ -0,0 +1,5 @@ +#!/usr/bin/perl + +use POSIX qw(strftime); +my $date = `rpm -q --queryformat='%{INSTALLTIME}\n' basesystem`; +printf strftime("%Y-%m-%d\n", localtime $date);