ssh-agent and crontab — is there a good way to get these to meet?

In addition…

If your key have a passhphrase, keychain will ask you once (valid until you reboot the machine or kill the ssh-agent).

keychain is what you need! Just install it and add the follow code in your .bash_profile:

keychain ~/.ssh/id_dsa

So use the code below in your script to load the ssh-agent environment variables:

. ~/.keychain/$HOSTNAME-sh

Note: keychain also generates code to csh and fish shells.

Copied answer from https://serverfault.com/questions/92683/execute-rsync-command-over-ssh-with-an-ssh-agent-via-crontab

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)