How to set cron to cpanel

I am using X10 hosting

Server https://boru.x10hosting.com

In addition to the cron job, I gave

Team /usr/bin/php -q /home/mohanphp/www/quote_bot/sms_cron.php >>/home/mohanphp/www/quote_bot/log/cron_log.txt 2>&1

I tried

/usr/bin/php -q /home/mohanphp/www/quote_bot/sms_cron.php >/dev/null 2>&1

/usr/bin/php -f /home/mohanphp/www/quote_bot/sms_cron.php >/dev/null 2>&1

I installed cron every 5 minutes.

Please help me what I did with the team.

+3
source share
3 answers

Here are some of my attempts :)

In my case, it worked fine:

wget -O /dev/null http://example.com/cron/my-cron.php >/dev/null

Also, everything works fine (I think this is better if we have "https: //" in the url):

/usr/bin/php -q /home/user/public_html/cron/my-cron.php >/dev/null

Other:

curl -s http://example.com/cron/my-cron.php >/dev/null 2>&1

If you do not want to receive a notification email about a specific cron job, add the following line to the command: >/dev/null 2>&1

Link: http://docs.cpanel.net/twiki/bin/view/AllDocumentation/CpanelDocs/CronJobs

+3
source

I use this:

/usr/bin/wget -q -O /dev/null "http://www.mydomain.com/myscript.php" > /dev/null 2>&1

+1
source

I use this in cPanel, working perfectly

wget http://site_name/file_location.php
-1
source

All Articles