[Lxc-users] Piping output of lxc-monitor to a file without buffering

Fajar A. Nugraha list at fajar.net
Fri Sep 7 06:13:34 UTC 2012


On Fri, Sep 7, 2012 at 7:46 AM, Ken Elkabany <Ken at elkabany.com> wrote:
> Hi,
>
> The following outputs container state changes to the terminal as expected:
>
> $ lxc-monitor -n container-1
>
> However, the following outputs the same state changes to a file only after a
> certain buffer size has been reached:
>
> $ lxc-monitor -n container-1 &> output
>
> This is problematic because it means that live monitoring cannot be done by
> a separate program. The buffering delays messages, potentially indefinitely.
>
> Is there a way around this?

(optional: start a screen session)
$ script -f /path/to/your-logfile.txt
$ lxc-monitor -n container-1

... and on other terminal
$ tail -f /path/to/your-logfile.txt

-- 
Fajar




More information about the lxc-users mailing list