Cron not working properly, throwing PHP Fatal errors
Recently, when I added a cron tab, I couldn't get it work no matter what I did. The file which I had to run via cron was inside the Drupal root and I added the following code to cron tab using,
*/5 * * * * /usr/bin/php /home/user/public_html/cron-rsync.php
The above code kept triggering PHP fatal errors saying that some of the files are missing and all. In a while, I realized what I was doing wrong. I have to specify to change the directory, so that the cron could load the file! So when I re-write the crontab as per below, it worked.
*/5 * * * * /usr/bin/php cd /home/user/public_html/ && php cron-rsync.php