Your Ad can be there
+ Post New Thread
Results 1 to 5 of 5

Thread: How to setup a cronjob

  1. #1
    Administrator
    Join Date
    Mar 2013
    Posts
    2,724

    How to setup a cronjob

    Hi, if You need to setup an cronjob on linux hosting. It might be cpanel, linux shell, here is how the command to run url in cron can look like:

    curl http://urlxyxyxy
    wget -O http://urlxyxyxy /dev/null
    wget -O – -q http://urlxyxyxy >/dev/null 2>&1

    (wget url alone would cause that website be downloaded into /home/user/ as a file! add -q to wget if you dont want to get email report of particular cronjob, q means quiet, >/dev/null 2>&1 will cause no email be sent too, also no file created)

    Every 5 minutes cronjob to run some URL:

    */5 * * * * curl http://example.com/check/

  2. #2


    Is this useful / helpfull? Yes | No
    If you are using cpanel then best and easy way to create cronjob is through cpanel:
    > Login to cpanel >> Cronjob

    You just have to use command to create cron job. You have to use below command to create cron job.
    crontab –e

    You can check complete steps to create cron job.

  3. #3


    Is this useful / helpfull? Yes | No
    Create a Cron Job
    Follow these instructions to create a new cron job.

    Step 1: Open Cron Jobs in cPanel by clicking Cron Jobs in the Advanced section.
    Step 2 Scroll down until you reach the Add New Cron Job interface.
    Step 3 Select an existing setting from the list of common settings. If you do this, all of the cron execution time fields will be filled automatically. Alternatively, you may define your unique runtime parameters in the following text boxes.
    Step 4 Enter the command you want to execute in the cron job.
    Step 5 To create a cron job, click the Add New Cron Job button.

  4. #4


    Is this useful / helpfull? Yes | No
    Setup Cron Job step below have a look.
    Step 1 − Open Cron Jobs by clicking Cron Jobs found in the Advanced section in cPanel.
    Step 2 − Scroll down to see Add New Cron Job interface.
    Step 3 − You can choose an existing setting from common settings. If you do that all the fields of cron execution time will automatically get filled.
    HiFiveHost : ★★ Fully Managed & Secure Web Hosting Solutions ★★ 24x7 Technical Support : Certified Professional : Server Management ★★

  5. #5
    Junior Member Rex_M's Avatar
    Join Date
    Apr 2022
    Posts
    14


    Is this useful / helpfull? Yes | No
    Quote Originally Posted by Fli View Post
    Hi, if You need to setup an cronjob on linux hosting. It might be cpanel, linux shell, here is how the command to run url in cron can look like:

    curl http://urlxyxyxy
    wget -O http://urlxyxyxy /dev/null
    wget -O – -q http://urlxyxyxy >/dev/null 2>&1

    (wget url alone would cause that website be downloaded into /home/user/ as a file! add -q to wget if you dont want to get email report of particular cronjob, q means quiet, >/dev/null 2>&1 will cause no email be sent too, also no file created)

    Every 5 minutes cronjob to run some URL:

    */5 * * * * curl http://example.com/check/
    Hello Fli,

    A cron job is a valuable process that allows you to automate several crucial web hosting tasks by specifying a command to run at scheduled intervals.

    You can use the Cron Jobs interface to automate
    specific commands or scripts on your site to
    run at a particular time. For example, you could
    set a cron job to remove temporary files every
    week to free up space and back up your website.

    Before setting up Cron Jobs, you must have good knowledge of Linux commands to avoid problems that can affect your website. Hence, you must check your script with your support team before creating a new cron job.

    You can follow the below-given ways to set up the Cron Job feature in cPanel,

    - Log in to your cPanel account, scroll down to the Advanced section and click the Cron Jobs icon.
    - You will get the option to change a notification email address. It will send you an email notification every time the cron job runs.
    - Your primary email is listed in the Cron Email section.
    - Update Email box used to send notifications to different email addresses.
    - Next, scroll to the Add New Cron Job section.
    - Here, you can set the frequency at which you want the cron job to operate.
    - Once you have set the cron job frequency, the next task is to input the command. Enter this in the Command field.
    - Click the Add New Cron Job button when finished. A confirmation pop-up will appear to ensure that the cron job has been added.
    - To check the created Cron Job, navigate to the Current Cron Jobs section at the bottom of the page. The Cron Job will appear at Current Cron Jobs.

    Lastly, you will be notified every time via email when the script runs on its provided time.

    I hope the above-given ways help you set up your new Cron Job task.

    -------------------
    Regards,
    Rex M

+ Post New Thread

Similar Threads

  1. What are Cronjob linux commands to run PHP file?
    By Fli in forum General Hosting Discussion
    Replies: 3
    Last Post: 07-12-2022, 01:25 PM
  2. WHMCS Cronjob 100% CPU, hosting suspended as a result
    By Fli in forum WHMCS (billing system)
    Replies: 0
    Last Post: 07-06-2017, 10:33 AM
  3. Replies: 1
    Last Post: 06-03-2016, 12:14 PM
  4. Replies: 0
    Last Post: 08-15-2013, 03:08 PM
  5. Shell Script - Cronjob for mysql backup?
    By Fli in forum MySQL, Apache, PHP
    Replies: 0
    Last Post: 05-24-2013, 10:10 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
 Protected by : ZB BLOCK  &  StopForumSpam