tags:

views:

35

answers:

1

This works fine when I run it by hand:

#!/bin/bash
eval `ssh-agent`
ssh-add
/usr/bin/scp me@server:~/file ./
exit 0

However, when the cron runs the file is never touched. I know the ssh keys are right - replace that scp with an ssh and it runs fine.

+1  A: 

cron generally is run as root, have you tested this script as root to ensure that the ssh keys are in the correct location that root looks for? Or do you have your sshkeys in your user profile?

OmnipotentEntity
I was under the impression that they ran as the user, but I was wrong! Using sudo to generate the key and pushing that one fixed the problem. Thanks!
Reed Morse