I tried to do a cron and run a url every 5 mintues.
I tried to use WGET however I dont want to download the files on the server, all I want is just to run it.
This is what I used (crontab):
*/5 * * * * wget http://www.example.com/cronit.php
Is there any other command to use other than wget to just run the url and not downlaod it?
wget -O- http://www.example.com/cronit.php >> /dev/null
This means send the file to stdout, and send stdout to /dev/null
If you want get output only when php fail:
php -r 'echo file_get_contents(http://www.example.com/cronit.php);'
This way you receive an email from cronjob only when the script fails and not whenever the php is called.
you can just use this code to hit the script using cron job using cpanel:
wget https://www.example.co.uk/unique-code
I tried following format, working fine
*/5 * * * * wget --quiet -O /dev/null http://localhost/cron.php
Source: Stackoverflow.com