I need to check my timestamp after "seconds since 1970-01-01 00:00:00 UTC" and print it to this csv file.
What's wrong in this code?
#!bin/bash echo %computername%, timestamp=$( date +%T ) >> "system_monitor.csv"
%s seconds since 1970-01-01 00:00:00 UTC
So you want
date +%s, not
And if by
%computername% you mean the hostname, use the
$HOSTNAME variable or the
hostname command. So, something like:
#!bin/bash echo "$HOSTNAME, timestamp=$( date +%s )" >> "system_monitor.csv"