miniCal
  • Quick Start
    • Introduction
  • miniCal Configuration
    • miniCal Hosted Service
    • Configure Feature Settings
    • Install Extensions
    • Create Multiple Properties
  • Local Installation
    • Local Installation
    • ENV Set-Up
    • Configuration Settings
    • Common Installations Errors
  • Contribution
    • Contribute to miniCal Core
  • Build an Extension
    • Build Your First Extension
      • Controllers
      • Assets
      • Config
      • language
      • Models
      • View
      • Helper
      • Library
      • Hooks
    • Open-source Extensions
    • Config Folder Files
      • Autoload File
      • Config File
      • Route File
    • miniCal Filters
    • miniCal Actions
    • Create Custom Hooks
    • Store Custom Data
      • POSTS
      • POSTMETA
      • OPTIONS
    • Composer Dependencies
  • Marketplace
    • miniCal Marketplace
  • Other resources
    • Overbooking for OTAs
    • miniCal Cron Setup
    • Automated Night Audit
    • Nginx Configuration
    • Docker Installation
    • Custom Domain Setup
  • Minical API Docs
    • API Documentation
  • Coming soon!
    • Access minical Data Using Helpers
      • Company Helper Functions
      • Customer Helper Functions
      • Booking Helper Functions
      • Rates Helper Functions
      • Rate Plan Helper Functions
      • Availability Helper Functions
      • Statement Helper Functions
      • Tax Helper Functions
      • Room Helper Functions
      • Charge Helper Functions
      • Payment Helper Functions
    • Access data in Extension
Powered by GitBook
On this page
  1. Other resources

miniCal Cron Setup

Cron is how miniCal does the scheduling time-based tasks. Several miniCal core features, such as checking for updates and getting bookings from OTA's like Booking, Airbnb, and Expedia, utilize Cron.

Understanding of miniCal Cron Scheduling

miniCal provides hooks to perform the cron job. Use any given action name and add your call-back function. Right now, the default intervals provided by miniCal are:

  • hourly-cron

  • daily-cron

Hourly-cron runs from the 0th hour to the 23rd hour a day, for example, if you have an OTA connection and you want your booking updated at every hour, then you can use this hourly-cron job. The same goes for the daily-cron; if you want to mail you the daily booking list at any specific time, you can use daily-cron for this.

Why Use Cron

  • miniCal core and many extensions need a scheduling system to perform time-based tasks. However, many hosting services are shared and do not provide access to the system scheduler.

  • miniCal makes sure that the job is done on the next page load if the job is not done.

How to Use Cron

// daily cron
add_action('daily-cron', 'your_callback_function', 10, 1);
function your_callback_function($data) {
  // this code will be executed on 0th hour every day
}

// hourly
add_action('hourly-cron', 'your_callback_function', 10, 1);
function your_callback_function($data) {
  // this code will be executed on 0th to 23rd hour every day
}
PreviousOverbooking for OTAsNextAutomated Night Audit

Last updated 3 years ago