How log pg_dump / pg_restore - Mailing list pgsql-admin

From Edwin UY
Subject How log pg_dump / pg_restore
Date
Msg-id CA+wokJ8Xxv6CBSaKhybFFHpmGuBjRyCkv0vGwVvbhcpUnmH_7Q@mail.gmail.com
Whole thread Raw
List pgsql-admin
Hi,

Is there a trick somehow to be able to log the output of pg_dump / pg_restore

I have this shell script to start with.

#!/bin/bash

SECONDS=0
START_pgdump=$( date )

pg_dump -v -d abcdb-U abc \
  -h abchost \
  --if-exists --clean -Fc \
  -f abcdumpfile.dmp \
  --quote-all-identifiers -n abc | tee -a pg_dump.log 2>pg_dump.err

FINISH_pgdump=$( date )

echo "START_pgdump  = ${START_pgdump}"
echo "FINISH_pgdump = ${FINISH_pgdump}"
echo "SECONDS       = ${SECONDS}"

IF I do

--quote-all-identifiers -n abc 1>pg_dump.log 2>pg_dump.err

I get the output but in the pg_dump.err. I'm confused. Any thoughts?

The main reason for wanting to capture the output is for where there are too many objects to pg_dump and it can be difficult scrolling through the screen to check for errors.




pgsql-admin by date:

Previous
From: ek ek
Date:
Subject: multi master issues
Next
From: Scott Ribe
Date:
Subject: Re: Multi-MASTER across different locations