Question: What is a cron job and how do I set one up? Print

  • GHFS web hosting, GHFS cloud hosting, GHFS Hosting, best hosting provider, shared hosting guide, domain and hosting tutorials, DNS configuration guide, how to register a domain, hosting control panel tutorial, VPS hosting setup, SSD web hosting, hosting knowledge base, managed hosting services, how to transfer a domain, MX record setup, DNS records explained, email hosting setup, A record guide, CNAME configuration, WordPress installation GHFS, SSL installation guide, WordPress migration guide, SSL certificate troubleshooting, optimize WordPress performance, FTP upload guide, fix internal server error, enable SSH access, Linux server commands, secure VPS server, PHP configuration guide, MySQL database tutorial, website security tutorial, DDoS protection GHFS, malware removal guide, VPS hosting tutorial, firewall configuration VPS, secure hosting best practices, Apache configuration guide, cloud server configuration, Nginx setup GHFS, disable root login SSH, how to manage Linux VPS, install Docker on VPS, Node.js on VPS, Python hosting tutorial, secure website setup, MySQL optimization, SMTP configuration guide, email deliverability guide, Plesk tutorial, hosting performance optimization, cPanel tutorial, Redis installation, SSL troubleshooting, hosting troubleshooting guide, server hardening tutorial
  • 0

Answer:

This article explains what a cron job is and how to configure one in Plesk on GHFS Hosting. Cron jobs allow your server to run automated tasks on a schedule.

1. What Is a Cron Job?

A cron job is an automated task that runs at specific intervals.
It can trigger scripts or commands without manual input.

Common uses include:

  • Running backups automatically

  • Clearing cache files

  • Executing PHP scripts

  • Updating applications or databases

  • Running scheduled tasks for CMS platforms (WordPress, Joomla, etc.)

Cron jobs ensure that scheduled actions happen consistently and automatically.


2. How to Set Up a Cron Job in Plesk

Steps:

  1. Log in to your Plesk control panel

  2. Go to Tools & Settings or Websites & Domains (depending on your plan)

  3. Click Scheduled Tasks

  4. Select Add Task

  5. Choose the type of task:

    • Run a command

    • Run a PHP script

    • Fetch a URL (if supported)

  6. Set the schedule using:

    • Minute

    • Hour

    • Day

    • Month

    • Day of week

  7. Enter your command or script path

  8. Click OK to save the task

Your cron job will now run automatically according to the schedule.


3. Common Examples of Cron Commands

Running a PHP script:

 
 
php /var/www/vhosts/yourdomain.com/httpdocs/cron.php

Fetching a script via URL (if allowed):

 
 
wget -q -O - https://yourdomain.com/cron.php

Running a shell command:

 
 
/usr/bin/php8.1 yourscript.php

Always adjust file paths and PHP versions to match your server configuration.


4. Understanding Cron Timing (Schedule)

Cron timing uses five fields:

 
 
* * * * * | | | | | | | | | ----- Day of week | | | ------- Month | | --------- Day of month | ---------- Hour ------------ Minute

Examples:

  • Every 5 minutes:

     
 

 

  • */5 * * * *
  • Daily at midnight:

     

 

 

 

  • 0 0 * * *
  • Once per hour:

     

 

 
  • 0 * * * *

5. When to Contact GHFS Hosting Support

Contact support if:

  • Your cron job is not running

  • You do not know which command to use

  • You need help creating script paths

  • Your CMS requires specific scheduled tasks

  • Permissions or resource limits are causing failures

Support can verify logs, correct paths, and help configure the correct cron command.


Was this answer helpful?

« Back