ssh&scp batch

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I've a strange problem :

I wrote a script with this line in :
scp -B myuser@myhost:/source/dir/myfile.tar.gz /target/dir
(ssh_agent launched via keychain)

if i execute my script via the console, it works fine

but if i launch it via cron => i have an error message !!???

an idea which will help me to solve this problem ???



Re: ssh&scp batch

Quoted text here. Click to load it

0. Is this an error message that you think we already know
   or that you don't like to quote ?

1. Do you mean ssh-agent when you have ssh_agent ?

2. Stuff that fails when called by cron but works from elsewhere
   has normally failed for lack of some environment setting.
   Compare "env" output from the two places.  Getting the cron
   job to source your .profile is a common solution.

3. In this case I suspect the stuff derived from ssh-agent is missing:
    SSH_AUTH_SOCK=/tmp/ssh-vOdx6785/agent.6785; export SSH_AUTH_SOCK;
    SSH_AGENT_PID=6786; export SSH_AGENT_PID;

Elvis Notargiacomo  master AT barefaced DOT cheek

Site Timeline