git://git.iain.cx/iain
/
profile.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
153e5b8
)
Script to guess Red Hat machine's build date.
author
Iain Patterson
<me@iain.cx>
Mon, 27 Jan 2014 14:31:17 +0000
(14:31 +0000)
committer
Iain Patterson
<me@iain.cx>
Mon, 27 Jan 2014 14:51:13 +0000
(14:51 +0000)
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
[new file with mode: 0755]
patch
|
blob
diff --git a/opt/Linux/bin/redhat_build_date
b/opt/Linux/bin/redhat_build_date
new file mode 100755
(executable)
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);