Re: Current log files when rotating?

Поиск
Список
Период
Сортировка
От hubert depesz lubaczewski
Тема Re: Current log files when rotating?
Дата
Msg-id 20081110195511.GA24778@depesz.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>)
Список pgsql-general
On Mon, Nov 10, 2008 at 11:44:31AM -0800, Joshua D. Drake wrote:
> Hmm what about just "ls -tu"
> Which if I am reading the man page correctly sorts by last access time.

which might not be what you need. the problem is that there is no
guarantee that the last "accessed" file is the current one.

on the other hand - there is also no such guarantee for current being
"last after sorting", so there is a room for failure here anyway.

the only way to do it without having problems with "strange" names or
dates of access:

ps uw -C postgres | grep logger | awk '{print "/proc/"$2"/fd"}' | xargs ls -l | grep /var/log/postgresql | awk '{print
$NF}'| xargs tail -f 

but it has its own set of problems ranging from "being totally
unreadable" to "requires running on postgres user or as root".

Best regards,

depesz

--
Linkedin: http://www.linkedin.com/in/depesz  /  blog: http://www.depesz.com/
jid/gtalk: depesz@depesz.com / aim:depeszhdel / skype:depesz_hdl / gg:6749007

В списке pgsql-general по дате отправления:

Предыдущее
От: "Scott Marlowe"
Дата:
Сообщение: Re: Current log files when rotating?
Следующее
От: "Joshua D. Drake"
Дата:
Сообщение: Re: Current log files when rotating?