title: Redirecting the output of a cron job
body: <p>I have the following entry in crontab:</p>
  
  <pre><code>0 5 * * * /bin/bash -l -c 'export RAILS_ENV=my_env; cd /my_folder; ./script/my_script.rb 2&gt;&amp;1 &gt; ./log/my_log.log'
  </code></pre>
  
  <p>The result of this is that I am receiving the output of <code>./script/my_script.rb</code> in <code>./log/my_log.log</code>. This behavior is desired. What is curious is that I am also receiving the output in my local mail. I am wondering how the output of my script is being captured by mail. Since I am redirecting the output to a log file, I would expect that my cron job would have no output, and thus I would receive no mail when the cron job runs. Can anyone shed some light as to how mail is able to get the output of <code>./script/my_script.rb</code>?</p>