title: Need to add mysql query in cron job
body: <p>I need to add a mysql query in a cron job. Tried some suggestions from here but not able to do.</p>
  
  <p>My query:</p>
  
  <pre><code>mysql -u root -pitvitv -e "use tvbsadmin; show full processlist;"&gt; /mydirectory/processlist_auto.txt.
  </code></pre>
  
  <p>Tried to write a script as below:</p>
  
  <pre><code>#!/usr/local/bin/bash
  /usr/local/bin/mysql -u root -pitvitv -e "use tvbsadmin; show full processlist;"&gt; /seachange/processlist_auto.txt
  </code></pre>
  
  <p>And then added in cron job as:</p>
  
  <pre><code>05 * * * * root /mydirectory/processlist.sh
  </code></pre>
  
  <p>please correct me if i am trying something wrong. Thanks in advance</p>