Networking

Unix and Linux network configuration. Multiple network interfaces. Bridged NICs. High-availability network configurations.

Applications

Reviews of latest Unix and Linux software. Helpful tips for application support admins. Automating application support.

Data

Disk partitioning, filesystems, directories, and files. Volume management, logical volumes, HA filesystems. Backups and disaster recovery.

Monitoring

Distributed server monitoring. Server performance and capacity planning. Monitoring applications, network status and user activity.

Commands & Shells

Cool Unix shell commands and options. Command-line tools and application. Things every Unix sysadmin needs to know.

Home » Commands & Shells

When Was that Server Built?

Submitted by on November 11, 2015 – 11:49 am

Just a quick note on how to (sort of) figure out when a server first came online. This can be useful to various folks in your bean-counting department working on maintenance contract renewals and whatnot. The idea is simple: figure out when the root filesystem was created and, in all likelihood, the server was built at around the same time. Not applicable to cloned virtual machines.

And here’s command:

date -d "$(/sbin/tune2fs -l `df -lP / | grep ^\/ | awk '{print $1}'` | grep created | head -1 | sed 's/:\s\+/@/g' | awk -F'@' '{print $NF}')" +'%Y-%m-%d %H:%M:%S'

 

Print Friendly, PDF & Email

Leave a Reply