pg_dump with plink.exe (putty)

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

Command:

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 I use native commands in the script, such as cp , mv , etc.

For commands such as pg_dump , pg_restore , createdb , it says that the command was not found.

PS: The same happens with putty.exe by windows cmd.

    
asked by anonymous 28.12.2016 / 19:55

1 answer

0

The solution to this problem was to place the entire path of the application. Ex: /opt/postgres/bin/pg_dump .

I still do not know why, but it does not recognize any of these external commands when run by the windows terminal.

    
29.12.2016 / 16:36