Search Postgresql Archives

Re: Current log files when rotating?

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

 



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)

depesz

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

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux