Re: Current log files when rotating?

Поиск
Список
Период
Сортировка
Искать
От
Scott Marlowe
Тема
Re: Current log files when rotating?
Дата
Msg-id
dcc563d10811101151h1f98f34ah32657e743c1be9ab@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Current log files when rotating? Greg Smith <gsmith@gregsmith.com>
Re: Current log files when rotating? "Joshua D. Drake" <jd@commandprompt.com>
Re: Current log files when rotating? "Joshua D. Drake" <jd@commandprompt.com>
Re: Current log files when rotating? Tom Lane <tgl@sss.pgh.pa.us>
Re: Current log files when rotating? hubert depesz lubaczewski <depesz@depesz.com>
Re: Current log files when rotating? "Joshua D. Drake" <jd@commandprompt.com>
Re: Current log files when rotating? hubert depesz lubaczewski <depesz@depesz.com>
Re: Current log files when rotating? "Joshua D. Drake" <jd@commandprompt.com>
Re: Current log files when rotating? Greg Smith <gsmith@gregsmith.com>
Re: Current log files when rotating? "Scott Marlowe" <scott.marlowe@gmail.com>
Re: Current log files when rotating? Alvaro Herrera <alvherre@commandprompt.com>
Re: Current log files when rotating? Tom Lane <tgl@sss.pgh.pa.us>
Re: Current log files when rotating? "Joshua D. Drake" <jd@commandprompt.com>
Re: Current log files when rotating? Steve Atkins <steve@blighty.com>
Re: Current log files when rotating? Sam Mason <sam@samason.me.uk>
Re: Current log files when rotating? Alex Shulgin <ash@commandprompt.com>
Re: Current log files when rotating? "Andrus" <kobruleht2@hot.ee>
Re: Current log files when rotating? Greg Smith <gsmith@gregsmith.com>
Re: Current log files when rotating? brian <brian@zijn-digital.com>
Re: Current log files when rotating? "Asko Oja" <ascoja@gmail.com>
On Mon, Nov 10, 2008 at 12:44 PM, Joshua D. Drake  wrote:
> 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.

ls -tr1 filename*|tail -n 1 will give you the most recently modified
file.  -tu will give you the file last accessed which may or may not
be the file you want.
В списке pgsql-general по дате отправления
От: Joshua D. Drake
Дата:
От: hubert depesz lubaczewski
Дата:
FAQ