title: ssh-agent and crontab -- is there a good way to get these to meet?
body: <p>I wrote a simple script which mails out svn activity logs nightly to our developers.  Until now, I've run it on the same machine as the svn repository, so I didn't have to worry about authentication, I could just use svn's file:/// address style.</p>
  
  <p>Now I'm running the script on a home computer, accessing a remote repository, so I had to change to svn+ssh:// paths.  With ssh-key nicely set up, I don't ever have to enter passwords for accessing the svn repository under normal circumstances.</p>
  
  <p>However, crontab did not have access to my ssh-keys / ssh-agent.  I've read about this problem a few places on the web, and it's also alluded to here, without resolution:</p>
  
  <p><a href="https://stackoverflow.com/questions/869589/why-ssh-fails-from-crontab-but-succedes-when-executed-from-a-command-line">Why ssh fails from crontab but succedes when executed from a command line?</a></p>
  
  <p>My solution was to add this to the top of the script:</p>
  
  <pre><code>### TOTAL HACK TO MAKE SSH-KEYS WORK  ###
  eval `ssh-agent -s`
  </code></pre>
  
  <p>This seems to work under MacOSX 10.6.  </p>
  
  <p>My question is, how terrible is this, and is there a better way?</p>