title: cronjob does not execute a script that works fine standalone
body: <p>I have my php script file in <code>/var/www/html/dbsync/index.php</code>. When <code>cd /var/www/html/dbsync/</code> and run <code>php index.php</code> it works perfectly.</p>
  
  <p>I want to call PHP file through sh file, the location of SH file is as below</p>
  
  <pre><code>/var/www/html/dbsync/dbsync.sh
  </code></pre>
  
  <p>This is the content of the <code>dbsync.sh</code> file is:</p>
  
  <pre><code>/usr/bin/php /var/www/html/dbsync/index.php &gt;&gt; /var/www/html/dbsync/myscript.log 2&gt;&amp;1 -q -f
  </code></pre>
  
  <p>When I <code>cd /var/www/html/dbsync/</code> and run <code>./dbsync.sh</code> it works perfectly as well.</p>
  
  <p>Now if I set up crontab as below:</p>
  
  <pre><code>1 * * * * /var/www/html/dbsync/dbsync.sh /var/www/html/dbsync
  </code></pre>
  
  <p>However, this crontab is not working as expected.</p>
  
  <p>What can be wrong?</p>