Find answers to your questions

Documentation

Cron Jobs/Automated Tasks

Introduction and overview

Cron jobs are commands used to schedule tasks that must run repeatedly, for example, every Saturday and Sunday at 12 PM. These jobs allow you to automate some commands and scripts on your server, to make it easier to run repetitive tasks. For instance, you could create a cron job to send notices through email every X days. This is a system process that runs in the background.

How to Create/Use

Cron jobs can be controlled via cPanel.

  1. Connect to your control panel and click on Advanced Tools > Cron Jobs.
  2. Click on Standard or Advanced, depending on your level of experience (Standard is recommended).
  3. Specify the command to run, its schedule, and click on Add New Cron Job.

Examples

To run a PHP script called script.php located in your /public_html/ folder, you can use the following Cron command:

/usr/local/bin/php -q /home/[username]/public_html/script.php > /dev/null


Replace

/home/[username]/public_html/script.php

by the path to your script.


By default, the cron job sends a confirmation of successful execution after each run. By adding

/dev/null

at the end of the command, you specify to the task that it should not send you an email.


If you want to learn how to delete Cron jobs, please click here.

For help with a Nuagerie service, open or follow up on a support request in your Client Area. For general questions, use our contact form.

Related Articles

What is cPanel and how do you access it? cPanel is the administration interface for your hosting account. It provides the tools available to that account without granting full server-administration access. Common toolsManage website files, domains and databases.Administer email accounts when mail is hosted within that service.Review storage and resource... cURL error 6: diagnose a hostname resolution failure The error curl: (6) Could not resolve host means cURL could not resolve the requested hostname. It can interrupt an update, download or API connection. On its own, it does not prove that your DNS resolver is faulty. For a Nuagerie hosting service, start by recording the error and its context. Do not change the... How can I activate my paid license after a trial? You can do this by running this command in SSH: /usr/local/cpanel/cpkeyclt It should look something like this: [root@cpanel home]# /usr/local/cpanel/cpkeyclt Updating cPanel license...Done. Update succeeded. Building global cache for cpanel...Done [root@cpanel home]# For help with a Nuagerie service, open or follow... When /cpanel, /webmail or /whm shortcuts do not work The /cpanel, /webmail and /whm shortcuts provide routes from a domain address to hosting management interfaces. An error on that route does not automatically mean your account is inaccessible. Identify the failing step so you can find the appropriate access method and give support useful observations. Start with a... How to protect a folder with a password Anyone can access subdirectories of public_html (folder containing all the public files of your hosting account) using a web browser. To restrict access to a particular directory under public_html: Connect to cPanel Click Directory Confidentiality in the Security topic. There you will find a list of subfolders....