Menu Close
    Start a Project Request quote Reading list Switch to dark mode

    How to set up Cron Job

    In this blog, we will learn to set up a Cron job. Basically Cron job is a command that we can run every minute, every hour, every day, once a year, etc.

    Basically Cron allows us to do is run a script on our site.

    Add Cron using Cpanel.

    Login to your Cpanel there you can see an advanced tab in the advanced tab you will see a Cron job. Click on this, you will be redirected to the Cron Job page.

    When the page will be open, Here we will see a setting to set a Cron Job, You can see an option of Cron Email, in this, you can set up an email on which, mail will be received every time when Cron is run. Here you have to set your Cron Job.

    You can see an option of common settings, here we will select when our Cron will run, like once a minute, once in an hour, once in a day…

    In the command section, you need to enter your file path and all set for Cron Job.

    file path example:- usr/local/bin/php -q/home/username_server/public_html/file_name.php

    Add Cron using Terminal

    If you wished to have a script named /root/script.php run at 10 pm on weekdays, your crontab entry would look like as follows. First, install your cronjob by running the following command:

    Using the same way you can add multiple Cron Job to your server.

    Some useful commands

    To list your all Cron Jobs

    To remove all crontab jobs use the following command:

    So here we end with this blog.


    . . .

    Comment (1)

    Add Your Comment

  • Ida
    Nice Post.
    If your hosting provider doesn’t allow setting cronjobs and you’re looking for a simpler solution, you might consider a webcron service which will load a specific URL at a given time.
  • Back to Top
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just recieved your project brief and our expert will contact you shortly.
    Send Again