SSH执行远程命令infacmd.sh失败

问题描述 投票:0回答:1
sshpass -p "xxx" ssh -t -t [email protected] 'cd /opt/tools/informatica/ids/Informatica/10.2.0/isp/bin;infacmd.sh oie importObjects -dn Domain_IDS_Dev -un abc -pd "xxx" -rs MRS_IDS_DEV -sdn LDAP_NP -fp /opt/tools/informatica/ids/Informatica/10.2.0/tomcat/bin/source/mapping_import.xml -cp /opt/tools/informatica/ids/Informatica/10.2.0/tomcat/bin/source/import_control_file.xml'| tee -a logfile.log

我正在Buildspec中的容器中运行上述命令,并在ec2实例中进行了测试,命令失败,并出现错误:sh: infacmd.sh: command not found

但是当我只尝试命令sshpass -p "xxx" ssh -t -t [email protected]并在ec2中手动执行其他命令时,该命令正在工作。

amazon-web-services ssh devops informatica
1个回答
0
投票

确保文件位于路径中。确保您有权访问该文件。确保文件是可执行文件,或将命令更改为

; / bin / bash infacmd.sh ...

© www.soinside.com 2019 - 2024. All rights reserved.