Getting Started

Deployment Deployment - Diagnose Migrations Staging

Site Management

Backups Client Reporting Passwords Plugin Automation Plugin Management - Global Plugins & Themes - Diagnose Plugins & Themes - General Plugins & Themes - Git Plugins & Themes - Logs Must Install SMTP White Label WordPress Updates

Caching & Performance

Caching Caching - Blogs/Articles Caching - Diagnose Caching - Git Caching - WooCommerce Redis Optimize & Scale

Security

Security Security - Firewall

CDN & DNS

CDN CDN - AWS CDN - Cloudflare CDN - Diagnose Domains & DNS

Server & Tools

CRON Jobs Database Debug Tool PHP Settings Redirects SEO Tools Server Errors sFTP SSL Monitoring Analytics & Logs

Staq Billing

Staq Billing > Account Staq Billing > Client Staq Billing > Setup

Media

Media Media - Diagnose Media - Optimize

Accounts & Billing

Accounts & Billing

General

WordPress Hosting Website Diagnose Troubleshoot - Other

How to setup a Cron job in Staq


On this page

    Cron jobs are essential for automating tasks in WordPress. The WordPress cron system is reliant on user interactions with the website. This means that scheduled tasks are only executed when a user accesses the site, causing delays.

    To have better control when CRON jobs operate, it is recommended that you go to Staq Panel for the site in question, and click WP Config File:

    Click Add and add DISABLE_WP_CRON as the name and the value as true

    Then, go back to Staq Panel and click Cron Manager:

    From there, you can add your desired commands based on the interval.

    Staq Cron Manager uses Linux Crontab Syntax.

    If you select Custom and do not know how to format your command, you can use this Crontab Generator

     

    Staq’s Approach

    Staq introduces a unique system for cron jobs, ensuring security and efficiency. Each Staq-hosted site operates in its own Linux user environment, having an individual crontab. This empowers users to integrate server cron jobs seamlessly.

    Utilizing Staq’s Cron Jobs

    Staq simplifies scheduled task management with key features:

    1. Secure Context: All jobs run within WordPress root, boosting security.
    2. Supported Commands:
      • WP CLI: Execute WP CLI commands like wp option delete cron.
      • wget / curl: Download files to WordPress directory, e.g., wget https://mydomain.com/data -P ./wp-content/data/.
      • PHP Execution: Run PHP files using php -f [filepath], relative to WordPress root.
      • File Permissions: Modify file permissions using chmod on relative paths.
      • Change Directory: Change directory using cd on relative paths.

    Chaining multiple commands using ‘&&’ is allowed, as long as each command adheres to the designated rules and conditions.

    Need some help?

    We all do sometimes. Please reach out to our support team by dropping us a support ticket. We will respond fast.