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.

Enjoyed this article? Share with friends

  • yutao

    An even easier way to set up cron job to access a URL, is using free cronjobs services.

  • i am getting error

    syntax error near unexpected token `newline’

  • i dont have cpanel access how do i setup cronjob >

  • jitendra patel

    But it not working. I am try in ubantu system by using putty set in crontab -e but it’s not working


Subscribe to our email feed and never miss a post

Join Us