bash脚本中的sshpass可以手动运行,但不能与cron一起使用

时间:2019-01-14 13:14:40

标签: bash sshpass

我在尝试由cron启动的bash脚本中启动sshpass时遇到问题。

我对cron进行了编程:

4 14 14 1 1 /Users/manuel/Downloads/prueba.sh

prueba.sh具有以下内容:

export SSHPASS=mypassword
sshpass -e ssh -oBatchMode=no user@host 'cd www;git pull;exit;'

然后我得到:

/Users/manuel/Downloads/prueba.sh: line 3: sshpass: command not found

但是,如果我在终端中手动启动脚本,它将起作用。怎么了?

我尝试使用sshpass (/usr/local/bin/sshpass)的完整路径和参数StrictHostKeyChecking=no。我不知道我怎么了。

谢谢。

0 个答案:

没有答案