Web Hosting Updated 22 September 2024

Cron jobs let you run a PHP script, URL, or shell command on a schedule — for example, sending scheduled emails, clearing cache, or running WordPress's background tasks.

Adding a Cron Job in Enhance

  1. Log in to web.teklanhosting.co.uk.
  2. Click your website, then go to Advanced → Developer tools → Cron jobs.
  3. Click Add cron job.
  4. Enter the command (run command or request URL) and set the interval.
  5. Save.

The cron jobs list shows each job's run command or request URL alongside its interval.

Cron Schedule Syntax

Cron schedules use five fields: minute, hour, day of month, month, day of week.

*  *  *  *  *
│  │  │  │  └── Day of week (0-7, Sunday = 0 or 7)
│  │  │  └───── Month (1-12)
│  │  └──────── Day of month (1-31)
│  └─────────── Hour (0-23)
└────────────── Minute (0-59)

Common examples:

* * * * *       Every minute
*/5 * * * *     Every 5 minutes
0 * * * *       Every hour (on the hour)
0 0 * * *       Every day at midnight
0 3 * * 1       Every Monday at 3am
0 0 1 * *       First day of every month at midnight

WordPress Cron (WP-Cron)

WordPress uses a pseudo-cron system that runs when someone visits the site. On low-traffic sites this can be unreliable. The recommended fix is to disable WP-Cron in wp-config.php and run it via a real server cron:

  1. Add this line to wp-config.php (before /* That's all */):
    define('DISABLE_WP_CRON', true);
  2. In Enhance, add a cron job with this command (replace the path with your actual path — check the Enhance file manager):
    /usr/bin/php -q /var/www/[your-site-uuid]/public_html/wp-cron.php
    Set the interval to every 5 minutes: */5 * * * *

Cron Job Output

By default, cron output is discarded. To capture it for debugging, redirect to a log file:

/usr/bin/php -q /path/to/script.php >> /home/username/logs/cron.log 2>&1

Remember to clear or rotate this log file periodically so it does not fill your disk quota.

More Web Hosting guides

Migrating Your Website to TekLan

Step-by-step: export files and databases from your old host, import them here, and cut over DNS with minimal downtime.

Setting Up Email Forwarding

Create a professional domain email address and forward it to any inbox - included free with every domain.

Getting to Know the Enhance Control Panel

A tour of the Enhance panel - where to find websites, email, databases, files, and account settings.

Creating a Website in Enhance

How to add a new website to your hosting account, choose a PHP version, and get a free SSL certificate.

Installing WordPress in Enhance

Use the built-in WordPress installer to get a fresh site live in under five minutes.

Installing WooCommerce in Enhance

Deploy WordPress with WooCommerce pre-installed in one step, then configure payments, products, and shipping.

Installing Joomla in Enhance

Use the built-in app installer to deploy a fresh Joomla site with the database and configuration handled automatically.

Creating Email Accounts in Enhance

Set up a domain mailbox, configure your mail client, and add forwarders or aliases.

Creating and Managing Databases in Enhance

Create a MySQL database and user, access phpMyAdmin, and manage database permissions.

FTP and SFTP Access in Enhance

Create FTP or SFTP credentials and connect with FileZilla or your preferred client.

SSL Certificates in Enhance

How Let's Encrypt SSL works in Enhance, how to force HTTPS, and what to do if a certificate fails to issue.

Changing Your PHP Version in Enhance

Switch PHP version per site, set custom php.ini values, and enable or disable extensions.

Adding Subdomains in Enhance

Create a subdomain as a separate website or as an alias pointing to an existing directory.

Backups and Restores in Enhance

Create manual snapshots, schedule automated backups, and restore files or databases from a previous state.

Creating a Staging Site in Enhance

Clone your live website to a staging environment, test changes safely, and push them back to production.

Using the File Manager in Enhance

Upload, edit, rename, compress, and delete files directly from your browser without an FTP client.

Managing Users and Roles in Enhance

How to invite additional users to your Enhance account, assign roles, and remove access when no longer needed.

Integrations in Enhance

Connect Cloudflare for automatic DNS sync or Slack to receive hosting notifications in your team channel.