Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

crontab problem

Status
Not open for further replies.
Mar 31, 2004
151
0
0
US

I have a script that does ssh connection to a remote server and runs well. I put the same script in cron. It doesn't seem to connect to the remote server. The script runs displaying all but the remote command output. I am using user crontab from my user login. Any ideas why the script is running at prompt and not from cron?
 
have you already exchanged keys between the two servers? If not, theres a good chance it is hanging at the key exchange prompt.
 
Thanks. The client's public key is in both servers. The same script when executed at prompt, just connects well and writes down the output to a file. If run from crontab, the script writes output relating to client (local ) machine but not the remote machines.
 
I found the solution. I had to include . profile in the script. It basically kills the current running agent and recreates ssh-agent.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top