Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to take backup of postgres from InstallAnyWhere which is installer for linux and windows machine.

I am calling pg_dump from Java process builder as command line below

cmdLine: [./pg_dump, -Ft, -b, -f, /tmp/temp1389348461928/postgresbackup, -h,, -p, 5432, -U, postgres, dbname]

Cannot run program "./pg_dump": error=2, No such file or directory

cmdLine is passed to the process Builder and PGPASSWORD is set before calling pg_dump

Same if call pg_dump from terminal it works fine.

 ./pg_dump -Ft -b -f /tmp/temp1389018812029/postgresbackup.tar -h -p 5432 -U postgres dbname

Thanks, Brijesh


migration rejected from Mar 11 '14 at 22:00

This question came from our site for professional and enthusiast programmers. Votes, comments, and answers are locked due to the question being closed here, but it may be eligible for editing and reopening on the site where it originated.

closed as off-topic by dezso, billinkc, RolandoMySQLDBA, ypercubeᵀᴹ, Max Vernon Mar 11 '14 at 22:00

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Too localized - this could be because your code has a typo, basic error, or is not relevant to most of our audience. Consider revising your question so that it appeals to a broader audience. As it stands, the question is unlikely to help other users (regarding typo questions, see this meta question for background)." – RolandoMySQLDBA, ypercubeᵀᴹ, Max Vernon
If this question can be reworded to fit the rules in the help center, please edit the question.

can you see ? No such file or directory – Rugal Jan 10 '14 at 10:27
@Rugal i am having pg_dump file in directory along with required libraries – Brijesh Jan 10 '14 at 10:27
Is the current working directory of the Java process the one that contains pg_dump? Or did you set the directory of the ProcessBuilder? – harmic Jan 10 '14 at 10:46
i am not setting explicitly any directory to the process builder just passing cmdLine parameters to the process builder. Do we need to set working directory?. – Brijesh Jan 10 '14 at 11:16
I don't understand why this was migrated from Stackoverflow as it is clearly a programming/Java problem. Not a "DBA problem" – a_horse_with_no_name Jan 10 '14 at 13:19