I\'m new to using cron job. I don\'t even know how to write it. I have tried to search from internet, but I still don\'t understand it well. I want to create a cron job that
In the same way you are trying to run cron.php, you can run another PHP script. You will have to do so via the CLI interface though.
#!/usr/bin/env php
Then, add an entry to the crontab:
* * * * * /usr/bin/php -f /usr/local/bin/run.php &> /dev/null
If the run.php script had executable permissions, it could be listed directly in the crontab, without the /usr/bin/php part as well. The 'env php' part, in the script, would find the appropriate program to actually run the PHP code. So, for the 'executable' version - add executable permission to the file:
chmod +x /usr/local/bin/run.php
and then, add the following entry into crontab:
* * * * * /usr/local/bin/run.php &> /dev/null