#!/usr/bin/perl -w use strict; use POSIX qw(setlocale strftime LC_ALL); setlocale(LC_ALL, "C"); my (@time, $dir, %pid, $oldtime, $newtime); my %conv = ( "send" => "o", "recv" => "i" ); while (<>) { @_ = split; next if (scalar(@_) < 4); @time = reverse(split(/[\/:]/, $_[0] . "/" . $_[1])); $time[4] -= 1; $time[5] -= 1900; $oldtime = $pid{"$_[2]"}; $newtime = strftime("%s", @time); $dir = $conv{"$_[3]"}; if (defined($dir) && scalar(@_) == 12) { printf "%s %s %s %s %s b _ %s a %s@ rsync 0 * c\n", strftime("%a %b %e %X %Y", @time), defined($oldtime) ? $newtime - $oldtime: $_[10], $_[4], $_[10], $_[8], $dir, substr($_[7], 1, -1); } $pid{"$_[2]"} = $newtime; }