Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try {
- String path = "ruta_donde_repaldar"
- Runtime r = Runtime.getRuntime();
- //PostgreSQL variables
- String user = "postgres";
- String dbase = "base_datos";
- String password = "tu_clave";
- Process p;
- ProcessBuilder pb;
- /**
- * Ejecucion del proceso de respaldo
- */
- r = Runtime.getRuntime();
- pb = new ProcessBuilder("pg_dump", "-v", "-D", "-f", path, "-U", user, dbase);
- pb.environment().put("PGPASSWORD", password);
- pb.redirectErrorStream(true);
- p = pb.start();
- } catch (Exception e) {
- }
Add Comment
Please, Sign In to add comment