title: How can i log error from my script.sh every time I run the script.sh and save output to a file?
body: <p>How can I save the error output when running my script to a file?
  I have my code bellow, but the code does not track error and save the error to test.log14.
  Can somebody give me a hint on what could be wrong in my code...</p>
  
  <pre><code> LOGFILE=/usr/local/etc/backups/test14.log
  
   "$(date "+%m%d%Y %T") : Starting work" &gt;&gt; $LOGFILE 2&gt;&amp;1
  </code></pre>