Understanding Cron Jobs

Web and Media Solutions

Understanding Cron Jobs

June 12, 2018 Configuration & Tweaks 0

The software utility cron is a time-based job scheduler in Unix-like computer operating systems. People who set up and maintain software environments use cron to schedule jobs (commands or shell scripts) to run periodically at fixed times, dates, or intervals. It typically automates system maintenance or administration—though its general-purpose nature makes it useful for things like downloading files from the Internet and downloading email at regular intervals.The origin of the name cron is from the Greek word for time, χρόνος (chronos).

cron is most suitable for scheduling repetitive tasks. Scheduling one-time tasks is often more easily accomplished using the associated at utility. Some cron implementations support the following non-standard macros:

Entry Description Equivalent to
@yearly (or @annually) Run once a year at midnight of 1 January 0 0 1 1 *
@monthly Run once a month at midnight of the first day of the month 0 0 1 * *
@weekly Run once a week at midnight on Sunday morning 0 0 * * 0
@daily Run once a day at midnight 0 0 * * *
@hourly Run once an hour at the beginning of the hour 0 * * * *
@reboot Run at startup N/A

 

Cron jobs allow you to automate certain commands or scripts in your cPanel account. You can set a command or script to run at a specific time at a specified interval. For example, you could set up a cron job to delete temporary files weekly to free up disk space.

WARNING: You must understand Linux commands well before you can use cron jobs effectively.

Here is an example for a lynx cron job:
lynx -source http://example.com/cron.php

Important: Please do not set your cron jobs to run in less than 30 minutes. We recommend this time frame in order to ensure the optimal execution of the configured scripts.

In a cPanel that most web developers will get when subscribing to a hosting package, they will typically see the below.

THESE ARE ALL TOO TECHNICAL? Use a web-base cron job scheduler – we use easycron. Click on “Create Account for Free” to start, as easy as that! If you would like to keep track on the Cron jobs that you have scheduled, create an account by just using your preferred email address and a password – click on to “Please add an email and password to complete your account registration.”

This slideshow requires JavaScript.

Leave a Reply