What is Cron?
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. cron is most suitable for scheduling repetitive tasks.
Cron in cPanel
cPanel provides a graphical interface for setting up your crontab. To access it, find "Cron Jobs" in the advanced section of your dashboard. Creating a new cron job is as simple as filling in the form fields. You can select from several pre-defined common timings or manually specify each of minute, hour, day, month, and weekday.
Some of the tools available in cPanel may schedule cron jobs automatically. For example, Softaculous backup tasks and Drupal update checks may appear in your crontab even if you have never used this interface before. Below is an example of the web-based view of your scheduled cron jobs.
Special considerations when running commands via Cron
When you run commands from a login shell, you have a set of environment variables that are referenced. The environment that cron has to work with is much more limited. Therefore, if your script depends on information provided by your environment it may not run correctly as a cron job. To avoid this issue, ensure that any variables you need are explicitly set from within you script and use the full path to any commands or supporting programs you may call. See below for an example of the differences between your login environment and the environment available to cron. The most likely cause of issues is the more limited "PATH" variable but any environment variables you have set for yourself will also be missing from cron's environment. You can review your own user environment by logging in via SSH and typing "env."