A duvida é como mudar o parametro do local de backup no java, na hora que altero para o caminho das pastas do linux da erro.
Caminho para as pastas
/usr/bin/pg_dump
public class Bkp {
public static void main(String args[]) throws IOException{
Bkp b = new Bkp();
b.realizaBackup();
}
public void realizaBackup() throws IOException {
Runtime r = Runtime.getRuntime();
try {
Process p = r.exec("\"C:\\Arquivos de programas\\PostgreSQL\\8.3\\bin\\pg_dump.exe\" -i -h localhost -p 5432 -U postgres -F c -b -v -f \"C:\\backup3\\teste.backup\" superAdmin");
if (p != null) {
OutputStream outputStream = p.getOutputStream();
outputStream.write("senha\r\n".getBytes());
outputStream.flush();
outputStream.close();
InputStreamReader streamReader = new InputStreamReader(p.getErrorStream());
BufferedReader reader = new BufferedReader(streamReader);
String linha;
while ((linha = reader.readLine()) != null) {
System.out.println(linha);
}
}
JOptionPane.showMessageDialog(null, "Backup realizado com sucesso!", "Aviso", JOptionPane.INFORMATION_MESSAGE);
} catch (IOException ex) {
JOptionPane.showMessageDialog(null, "Erro ao tentar realizar o backup!\n"+ex.getMessage(), "Erro", JOptionPane.ERROR_MESSAGE);
}
}