Setting a cron job to visit a url

Setting a cron job to visit a url

Cron jobs help to run a script on a given interval. You can set a cron job to visit a web page on a given time.  This article explains how to create a cron job easily in cpanel.

First log in to cpanel and click the cron jobs button. In most cpanels this is in the Advanced section at the bottom.

advanced tab on cpanel

Then you will get the screen where you can set a cron job.

cron job

In this screen first select the interval you want to run the script. Most of the time your required interval will be on the list of common settings.

Then in the command box enter following code.

۱ wget -q -O - >/dev/null 2>&1

Make sure to replace your url with  Here the code >/dev/null 2>&1 make sure no email is sent to admin email once a cron job is done successfully. Remove that part from the command if you like to receive email. But be aware that this can end up with filling your inbox with hundreds of emails from cron job.

This method can be used to set up cron jobs for wordpress too. It will be helpful for wordpress plugins which requires a better cron schedule.

5 سال پیش

دیدگاهتان را بنویسید

نشانی ایمیل شما منتشر نخواهد شد. بخش‌های موردنیاز علامت‌گذاری شده‌اند *

این سایت از اکیسمت برای کاهش هرزنامه استفاده می کند. بیاموزید که چگونه اطلاعات دیدگاه های شما پردازش می‌شوند.