title: Using git as backup tool with cron and ssh aliases
body: <p>I have a repository for storing all my configs (e. g. .ssh/config). From time to time I need a backup them, so I need to run these commands </p>
  
  <pre><code>git commit -am 'Auto git backup `date -I`'
  git push origin master
  </code></pre>
  
  <p>It is pretty annoying so I decided to make a cron job, which runs simple script with these lines above. I ran <code>crontab -e</code> and added new line at the end of file. I also replaced <code>git</code> with <code>which git</code> inside of script. <code>git commit</code> command works perfectly in contrast with <code>git push</code>. When I made some debug prints I got</p>
  
  <pre><code>ssh: Could not resolve hostname bitbucket.org: Name or service not known
  fatal: Could not read from remote repository.
  Please make sure you have the correct access rights
  and the repository exists.
  </code></pre>
  
  <p>But when I run script manually, it works. I think it is because of SSH aliases in my <code>.ssh/config</code>, which looks like </p>
  
  <pre><code>Host     bitbucket.org-personal
  HostName bitbucket.org
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/id_rsa
  
  Host    bitbucket.org-work
  HostName bitbucket.org
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/another_id_rsa
  </code></pre>
  
  <p>Does somebody have idea, how to propagate SSH aliases to environment, which runs cron jobs? Also maybe I am wrong and problem is caused by something else.</p>