I want to execute .sql file at /x/y/z location of a UNIX server, using ANT script from my local Windows XP system. The .sql files are at UNIX server.
I have used the below ant target from my Windows XP system:
<target name="execute" >
<sshexec host="hostname"
username="UNIX system username"
keyfile="/export/home/appldev/.ssh/id_dsa"
commandResource="psql -f /u01/appldev/devappl/po/11.5.0/reports/xxbt/1.0.0/sql"/>
</target>
I have tried the below post keyfile error:
<target name="execute" >
<sshexec host="server_ip"
username="server_uname"
password="server_pass"
command="touch abc"/>
</target>
Got the error:
Buildfile: C:\Program Files\Java\apache-ant-1.8.1\build.xml
execute:
[sshexec] Connecting to server_IP:22
BUILD FAILED
C:\Program Files\Java\apache-ant-1.8.1\build.xml:49: com.jcraft.jsch.JSchExcepti
on: connection is closed by foreign host
Please help.