title: Cron job stderr to email AND log file?
body: <p>I have a cron job:</p>
  
  <pre><code>$SP_s/StartDailyS1.sh &gt;$LP_s/MirrorLogS1.txt
  </code></pre>
  
  <p>Where <code>SP_s</code> is the path to the script and <code>LP_s</code> is the path for the log file. This sends stdout to the log file and stderr to my email. </p>
  
  <p>How do I?:<br>
  1) send both stdout AND stderr to the logfile,<br>
  2) AND send stderr to email</p>
  
  <p>or to put it another way: stderr to both the logfile and the email, and stdout only to the logfile.</p>
  
  <p>UPDATE:
  None of the answers I've gotten so far either follow the criteria I set out or seem suited to a CRON job.</p>
  
  <p>I saw this, which is intended to "send the STDOUT and STDERR from a command to one file, and then just STDERR to another file" (posted by zazzybob on unix.com), which seems close to what I want to do and I was wondering if it would inspire someone more clever than I: </p>
  
  <pre><code>(( my_command 3&gt;&amp;1 1&gt;&amp;2 2&gt;&amp;3 ) | tee error_only.log ) &gt; all.log 2&gt;&amp;1 
  </code></pre>
  
  <p>I want cron to send STDERR to email rather than 'another file'.</p>