Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Apache: Logging: how-to pipe logs or logtoanothermachine(was Disk



>>>>> "VP" == Viktor Pavlenko <vvp@example.com> writes:

    VP> $ perl -e 'select(STDOUT); $|=1; for (0..1000000) { print 1; sleep 1 && system("ls -l t.gz >> t") unless $_ % 200000; }' | gzip - > t.gz

    VP> And watch content of file t with tail -f from another. (You may need
    VP> to remove a couple of zeros above, my machine is very fast:) This is
    VP> what I see:

    VP> $ tail -f t
    VP> -rw-rw-r--    1 vik      vik             0 Sep  8 10:51 t.gz
    VP> -rw-rw-r--    1 vik      vik             0 Sep  8 10:51 t.gz
    VP> -rw-rw-r--    1 vik      vik             0 Sep  8 10:51 t.gz

    VP> Any ideas why?

Because the resulting t.gz is very small. Replacing print 1 with print
$_ makes it clear. Never mind... But isn't it fun ? :)

Viktor


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links