Thread: logging pg_dump results in windows 7
I'm currently running Postgres version 9.0.1 (haven't gone to 9.0.7 yet but soon) in a Windows 7 Professional x64 environment. I run a pg_dump of certain DBs every night and would like to log the pg_dump results into a file. I'm just wondering what the best method for this is. The pg_dump command I use is contained in a *.bat file. The actual follows this format: pg_dump.exe -h my_host -p my_port -U my_user -w -F c -b -v -f C:\testbackup postgres I've tried the following commands to redirect the output to a file: pg_dump.exe -h my_host -p my_port -U my_user -w -F c -b -v -f C:\testbackup postgres>C:\testlog.txt pg_dump.exe -h my_host -p my_port -U my_user -w -F c -b -v -f C:\testbackup postgres|echo C:\testlog.txt Both fail to produce anything. I've searched the darkest corners of the net for an answer to this and come up with nothing. Which makes me feel that this is extraordinarily simple. Am I correct? Sleeper -- Owen Sleep DOCFOCUS INC. Suite 103, 17505 - 107 Avenue Edmonton, Alberta T5S 1E5 Email: osleep@docfocus.ca Support: dfisupport@docfocus.ca WebSite: www.docfocus.ca
On Thu, Apr 19, 2012 at 11:15 PM, Owen Sleep <osleep@docfocus.ca> wrote:
I'm currently running Postgres version 9.0.1 (haven't gone to 9.0.7 yet but soon) in a Windows 7 Professional x64 environment.
I run a pg_dump of certain DBs every night and would like to log the pg_dump results into a file. I'm just wondering what the best method for this is.
The pg_dump command I use is contained in a *.bat file. The actual follows this format:
pg_dump.exe -h my_host -p my_port -U my_user -w -F c -b -v -f C:\testbackup postgres
I've tried the following commands to redirect the output to a file:
pg_dump.exe -h my_host -p my_port -U my_user -w -F c -b -v -f C:\testbackup postgres>C:\testlog.txt
pg_dump.exe -h my_host -p my_port -U my_user -w -F c -b -v -f C:\testbackup postgres|echo C:\testlog.txt
Both fail to produce anything.
I've searched the darkest corners of the net for an answer to this and come up with nothing. Which makes me feel that this is extraordinarily simple.
Am I correct?
Sleeper
Try with below command to log all messages into log file:
pg_dump.exe -h my_host -p my_port -U my_user -w -Fc -b -v -f C:\testbackup postgres >>C:\testlog.txt 2>>C:\testlog.txt
Thanks & Regards,
Raghu Ram
EnterpriseDB: http://www.enterprisedb.com
Run you command and redirect to a file. Like this:
pg_dump.exe > pg_dump.sql
This will dump the output of pg_dump to pg_dump.sql.
On 4/19/2012 1:45 PM, Owen Sleep wrote:
pg_dump.exe > pg_dump.sql
This will dump the output of pg_dump to pg_dump.sql.
Jim Blizard
Technology Director
Black Sheep Ventures, LLC
678.343.7771
Technology Director
Black Sheep Ventures, LLC
678.343.7771
On 4/19/2012 1:45 PM, Owen Sleep wrote:
I'm currently running Postgres version 9.0.1 (haven't gone to 9.0.7 yet but soon) in a Windows 7 Professional x64 environment.
I run a pg_dump of certain DBs every night and would like to log the pg_dump results into a file. I'm just wondering what the best method for this is.
The pg_dump command I use is contained in a *.bat file. The actual follows this format:
pg_dump.exe -h my_host -p my_port -U my_user -w -F c -b -v -f C:\testbackup postgres
I've tried the following commands to redirect the output to a file:
pg_dump.exe -h my_host -p my_port -U my_user -w -F c -b -v -f C:\testbackup postgres>C:\testlog.txt
pg_dump.exe -h my_host -p my_port -U my_user -w -F c -b -v -f C:\testbackup postgres|echo C:\testlog.txt
Both fail to produce anything.
I've searched the darkest corners of the net for an answer to this and come up with nothing. Which makes me feel that this is extraordinarily simple.
Am I correct?
Sleeper