Originally published January 7, 2018 @ 11:00 pm

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'