简体   繁体   中英

Java runtime pg_dump with log

I'm running pg_dump in java runtime using this command:

final static String cmd = "/usr/lib/postgresql/9.3/bin/pg_dump -U jboss -v wsemp0316 -f /home/test/test.pg_dump -f /home/test/test.log";

Problem is it does not create the file test.pg_dump but throws the actual data to test.log. I'm guessing its the -f as I used twice but using 1> and 2> throws an error. Anyone encountered this?

Maybe you should take a look at the pg_dump documentation .

-f file --file=file Send output to the specified file. This parameter can be omitted for file based output formats, in which case the standard output is used. It must be given for the directory output format however, where it specifies the target directory instead of a file. In this case the directory is created by pg_dump and must not exist before.

My understanding is that the parameter -f should be used only once.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM