From 08392e37a0280a6943b36d0b857f916cd650a3d5 Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Mon, 27 Jan 2014 14:31:17 +0000 Subject: [PATCH] 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. --- opt/Linux/bin/redhat_build_date | 5 +++++ 1 file changed, 5 insertions(+) create mode 100755 opt/Linux/bin/redhat_build_date 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); -- 2.7.4