CRON Setup

Understanding CRON Jobs for Baza Booking Calendar

CRON jobs are scheduled tasks that run automatically on your server at specified intervals. For WordPress plugins like Baza Booking Calendar, CRON jobs ensure that background processes—such as updating bookings, sending notifications, and processing payments—run on time, even if no one is actively visiting your website.

In the examples

In the examples provided for different hosting providers, you may notice commands like wget, curl, or php followed by the URL or file path to wp-cron.php. Here’s a breakdown of the key components:

  • /usr/bin/wget – This runs the wget command, which fetches the specified URL. It is often used when PHP CLI is not available.
  • /usr/bin/curl -s – This runs curl in silent mode (-s) to request the URL without showing output.
  • /usr/bin/php -f – This runs a PHP script file directly using the PHP command-line interface.
  • >/dev/null 2>&1 – This redirects both standard output (stdout) and standard error (stderr) to /dev/null, effectively silencing any messages or errors so they do not clutter your logs.
  • -t 1 – For wget, this sets the number of retries in case of failure (in this example, 1 retry).
  • Quotation marks (' or ") – Used to wrap URLs or file paths that may contain special characters or spaces, ensuring the command interprets them correctly.
  • $HOME – Represents the home directory of the user under which the CRON job runs.

Why Use These Formats

  1. wget or curl – Useful if your host does not allow direct PHP CLI execution or if you want the task to run via HTTP request.
  2. php -f – Preferred when you can execute PHP directly, as it is faster and does not depend on HTTP.
  3. Output Redirection (>/dev/null 2>&1) – Keeps CRON logs clean and avoids sending unnecessary output to email.
  4. Silent Mode (-s) – Prevents logging of unnecessary messages while still running the task.

Important: Always check with your hosting provider to ensure the CRON command syntax is correct for your server environment. The examples provided may need adjustments depending on PHP version, server paths, or hosting restrictions.

Provider Commands

To schedule a CRON job for the Baza Booking Calendar plugin, use the following commands depending on your hosting provider:

Hosting Ukraine

/usr/bin/wget -t 1 -O - 'https://yoursite.com/wp-cron.php?doing_wp_cron' >/dev/null 2>&1

Hetzner

/usr/bin/curl -s 'https://yoursite.com/wp-cron.php?doing_wp_cron' >/dev/null 2>&1

OVH

/usr/bin/php -f /home/username/public_html/wp-cron.php >/dev/null 2>&1

Hostinger

/opt/alt/php81/usr/bin/php /home/u123456789/domains/yoursite.com/public_html/wp-cron.php >/dev/null 2>&1

SiteGround

/usr/local/bin/ea-php81 /home/customer/www/yoursite.com/public_html/wp-cron.php >/dev/null 2>&1

GoDaddy

/web/cgi‑bin/php8.1 "$HOME/html/wp-cron.php" >/dev/null 2>&1

Bluehost

*/30 * * * * cd ${HOME}/public_html; php -q wp-cron.php >/dev/null 2>&1 hosting.com+1

A2 Hosting / DigitalOcean / VPS

*/5 * * * * wget -q -O - https://yoursite.com/wp-cron.php?doing_wp_cron >/dev/null 2>&1

Note: Always verify the correct syntax and paths for CRON jobs with your hosting provider, as the information provided here may change or vary depending on the hosting environment.