hello,
I have a log file in which first + last line are:
2015/11/26 10:12:39 [27741] building file list
2015/11/26 10:17:31 [27741] total size is 33199684413 speedup is 5914.76
I want to check how log rsync was running by subtracting dates from line 2 to 1 (converted to epoch).
my current solution is:
# sed -e 1b -e '$!d' logfile|awk '{print $1,$2}'|sed 'N;s/\n/ /'|while read s0 s1 e0 e1;do echo $(date -d "$e0 $e1" "+%s")-$(date -d "$s0 $s1" "+%s")|bc;done
292
can one awk command do it without extra commands and pipes?