Re: Current log files when rotating?

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: depesz(at)depesz(dot)com
Cc: Greg Smith <gsmith(at)gregsmith(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Current log files when rotating?
Date: 2008-11-10 19:44:31
Message-ID: 1226346271.21694.62.camel@jd-laptop.pragmaticzealot.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 2008-11-10 at 20:12 +0100, hubert depesz lubaczewski wrote:
> On Mon, Nov 10, 2008 at 01:46:14PM -0500, Greg Smith wrote:
> > strftime would both work I guess, those just seemed a little heavy (was
> > hoping for an "alias"-sized answer) to figure out something that the
> > server certainly knows.
>
> it's not nice, but it works:
> alias pgtail='/bin/ls -1 /var/log/postgresql/postgresql*log | tail -n 1 | xargs tail -f'
>
> of course it has some assumptions:
> 1. your logs are in /var/log/postgresql/ directory (easy to change)
> 2. your logs are named in such way that sorting them alphabetically will
> sort them chronologically (i.e. %Y-%m-%d or something similar) (not easy
> to change)

Hmm what about just "ls -tu"

Which if I am reading the man page correctly sorts by last access time.

Joshua D. Drake

>
> depesz
>
> --
> Linkedin: http://www.linkedin.com/in/depesz / blog: http://www.depesz.com/
> jid/gtalk: depesz(at)depesz(dot)com / aim:depeszhdl / skype:depesz_hdl / gg:6749007
>
--

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2008-11-10 19:51:57 Re: Current log files when rotating?
Previous Message Asko Oja 2008-11-10 19:29:27 Re: Current log files when rotating?