Query OS install date for Linux

(imported topic written by Neetha_M)

Hi,

I am trying to create a property that will query the

OS install date

for Linux systems. The OS install date for Linux can be got as follows:

rpm -qi setup

Name : setup Relocations: (not relocatable)

Version : 2.5.58 Vendor: Red Hat, Inc.

Release : 9.el5 Build Date: Mon 05 Dec 2011 11:08:07 PM IST

Install Date: Fri 19 Oct 2012 04:54:33 PM IST

Build Host: s390-010.build.bos.redhat.com

Group : System Environment/Base Source RPM: setup-2.5.58-9.el5.src.rpm

Size : 0 License: public domain

Signature : DSA/SHA1, Wed 18 Jan 2012 09:05:58 AM IST, Key ID 5326810137017186

Packager : Red Hat, Inc. http://bugzilla.redhat.com/bugzilla

Summary : A set of system configuration and setup files.

Please help.

(imported comment written by sinucus)

I would do something like the following

first 27 of following texts of first 14 of lines whose (it starts with “Install”) of file “c:\linux.txt”

Obviously you’ll need an input file, you could call the rpm -qi setup and output it to text file, or appendfile and then parse and delete.

Hopefully this sets you on the right track