Take the 2-minute tour ×
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. It's 100% free, no registration required.

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, 127.0.0.1, -p, 5432, -U, postgres, dbname]

Cannot run program "./pg_dump": java.io.IOException: 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 127.0.0.1 -p 5432 -U postgres dbname

Thanks, Brijesh

share
3  
can you see ? No such file or directory –  Rugal Jan 10 at 10:27
    
@Rugal i am having pg_dump file in directory along with required libraries –  Brijesh Jan 10 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 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 at 11:16
2  
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 at 13:19
show 2 more comments

migration rejected from stackoverflow.com Mar 11 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 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.

Browse other questions tagged or ask your own question.