I call a script from cron job. In the script it needs to run CVS commands to update from a remote repository. To do that, it needs to SSH authenticate.
I put the following code in the script
...
ROOTPATH="/Users/qazwsx/project/"
cd $ROOTPATH
SSHAGENT="${ROOTPATH}ssh-agent.cf"
if [ -f "$SSHAGENT" ]; then
rm "$SSHAGENT"
fi
ssh-agent -s | head -n 2 > "$SSHAGENT"
if [ -f "$SSHAGENT" ]; then
echo "$SSHAGENT"
source "$SSHAGENT"
ssh-add
#function killsshagent {
# /bin/kill $SSH_AGENT_PID
#}
#trap killsshagent EXIT
rm "$SSHAGENT"
fi
...
But when the script is run, a window as the following show up:
and I could NOT type anything into the input field. So the steps after the SSH authentication did not successfully run because the SSH access was not established. I'm wondering what I should do to do CVS update in cron job.