pg_dump with Plink.exe(Putty)

Asked

Viewed 106 times

0

I need to run some ssh commands on my linux server, from a windows machine via cmd.

For this I am using Plink.exe

Commando:

plink -ssh [email protected] -pw 12345 -m script

Script:

pg_dump -U master dados -v -Fc -f /sistema/dados/dados.bak

This command works normally when using native commands in the script, such as cp, mv, etc..

For commands like pg_dump, pg_restore, createdb, he says the command was not found.

PS.: The same happens using Putty.exe by windows cmd.

1 answer

0

The solution to this problem was to put the entire application way. Ex.: /opt/postgres/bin/pg_dump.

I still don’t know why, but it doesn’t recognize any of these external commands when run by windows terminal.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.