I have several PHP files that cron will execute. I installed crons using the command -
crontab crontab.txt
Inside the crontab.txt file, I wrote cron commands as follows: -
But none of the functions work (database queries, sending reminder emails, etc.). Managing URLs is manual.
Then I put my mailing address in MAILTO and received the mail. By mail I received all the HTML code for the page. What is expected in the mail? Why are my functions not working?
Update
If I change my cron commands to
#(Updating tutor activities) - every minute * * * * * /usr/bin/wget http://project/cron/tutor_activities.php
Still no success, and it comes to my mail -
--15:03:01-- http://project/cron/tutor_activities.php => `tutor_activities.php' Resolving project... IP Address Connecting to test.project|IP Address|:80... connected. HTTP request sent, awaiting response... 301 Moved Permanently Location: http://project./ [following] --15:03:01-- http://project./ => `index.html.1' Resolving project.... IP Address Connecting to project.|IP Address|:80... connected. HTTP request sent, awaiting response... 302 Found Location: http://project/home/ [following] --15:03:01-- http://project/home/ => `index.html.1' Resolving project... IP Address Connecting to wproject|IP Address|:80... connected. HTTP request sent, awaiting response... 200 OK Length: unspecified [text/html] index.html.1 has sprung into existence. Retrying.
And at the root of my project, a lot of files index.html.1 , index.html.2 have accumulated. I do not want these files to be created. I just want the files to execute.
The same results if I use one of the two commands -
* * * * * /usr/bin/wget http://project/cron/tutor_activities.php * * * * * wget http://project/cron/tutor_activities.php
running php command with MAILTO set sends me this error / bin / sh: php: command not found.
* * * * * php /path/to/test.php
So, I can not use the php command.
I wrote a simple mailto() inside my test.php. Mail does not arrive when it is executed via cron (using both wget and php ), but the URL works manually.
My problem
To clarify again, my main problem is that the functionality inside the cron files is not running. Creating files is a secondary issue.
Any help would be appreciated
Thanks,
Sandeepan