# Print start and end times of rsync transfer of complete short test fileset # (xaa, xab, etc), based on content of sync-test script output log. BEGIN { inSet = 0; finishedSet = 0; tzOffsetSec = 7 * 3600; FS = "," printf "# startSec endSec durationSec\n"; } NR == 1 { printf "# Input: %s\n", FILENAME; } /xaa/ { ## printf "Start: %s, %d\n", timeTag, startEpochSec; ### printf "started set at %s\n", startTag; if (inSet) { # started another set without finishing previous ### print "-RESTARTED"; print ""; } inSet = 1; startEpochSec = epochSec; startTag = timeTag; printf "%d ", startEpochSec; } /UTC/ { cmd = sprintf("ut2et -format '%%a %%b %%d %%H:%%M:%%S UTC %%Y' '%s'", $1); cmd | getline epochSec; epochSec -= tzOffsetSec; timeTag = $1; close(cmd); if (finishedSet) { duration = epochSec - startEpochSec; ## printf "Finish: %s, %d, %d sec\n\n", $0, epochSec, duration; printf "%d %d %s %s\n", epochSec, duration, startTag, $0; finishedSet = 0; } } /xba/ { finishedSet = 1; inSet = 0; } END { print ""; }