Re: Fwd: Export vaccumdb messages

Поиск
Список
Период
Сортировка
От Wei Shan
Тема Re: Fwd: Export vaccumdb messages
Дата
Msg-id CAFe9ZTpBnaF3s-eVku-ey4rffCNTouWqWP9KQAp_hPWN2UFNvw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Fwd: Export vaccumdb messages  (Marco Nietz <pg@mnietz.de>)
Ответы Re: Fwd: Export vaccumdb messages  (Edgar Delgado <edgdelgado@gmail.com>)
Список pgsql-admin
Hi,

Just for sharing. This is what I'm doing now.

Crontab
0 0 * * * su - postgres -c /var/lib/pgsql/postgres_vacuum.sh

Script
# cat /var/lib/pgsql/postgres_vacuum.sh
#!/bin/bash

echo `date` >> /var/lib/pgsql/postgres_vacuum.log

ps -aef | grep 'wal sender' | grep -v 'grep wal sender' > /dev/null

if [ $? -eq 0 ]; then
        /usr/pgsql-9.2/bin/vacuumdb -avz >> /var/lib/pgsql/postgres_vacuum.log 2>>&1
else
        echo "This is a postgres slave. Don't vacuum it!" >> /var/lib/pgsql/postgres_vacuum.log
fi

Hope this helps.

On 2 September 2015 at 02:54, Marco Nietz <pg@mnietz.de> wrote:
Hi,

try it like this:

vacuumdb -v > /tmp/your.log 2>&1


Best,

 Marco



Am 01.09.2015 um 19:21 schrieb Edgar Delgado:


Hi.

How can I export the INFOS that generates from running vaccumdb? Tried
">>" but I don't receive this kind of information:


INFO:  analyzing "pg_catalog.pg_foreign_data_wrapper"
INFO:  "pg_foreign_data_wrapper": scanned 0 of 0 pages, containing 0
live rows and 0 dead rows; 0 rows in sample, 0 estimated total rows
INFO:  vacuuming "pg_catalog.pg_shseclabel"
INFO:  "pg_shseclabel": found 0 removable, 0 nonremovable row versions
in 0 pages
DETAIL:  0 dead row versions cannot be removed yet.
CPU 0.00s/0.00u sec elapsed 0.00 sec.

I need to generate a log of this and send over e-mail.


Thanks,



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



--
Regards,
Ang Wei Shan

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

Предыдущее
От: Marco Nietz
Дата:
Сообщение: Re: Fwd: Export vaccumdb messages
Следующее
От: Edgar Delgado
Дата:
Сообщение: Re: Fwd: Export vaccumdb messages