Skip to Content
GuidesSetup CRON

Setting Up CRON for Flute CMS

CRON is a task scheduler that allows automatic execution of resource-intensive operations in the background. Flute CMS uses CRON for server monitoring, sending notifications, cache clearing, and other automated tasks.

⚠️

Important! CRON must run every minute for all Flute CMS functions to work correctly.

Enabling CRON in Admin Panel

Before setting up CRON on the server, you need to enable it in the Flute CMS admin panel.

Log into admin panel

  1. Open your site and log into the admin panel
  2. Make sure you have the permissions:
    • admin.system (system administrator)
    • admin.boss (chief administrator)

Go to general settings

  1. In the admin panel find the “Settings” section
  2. Go to “General Settings”

Enable CRON

  1. Find the “Enable CRON” setting
  2. Set the toggle to “Enabled”
  3. Save settings

Enabling CRON in admin panel

After enabling CRON in the admin panel, the system will be ready to execute automatic tasks.

Setting Up CRON on Server

Command to execute: php flute cron:run

⚠️

Use the same PHP version as for the web server! Usually this is PHP 8.2 or higher.

FastPanel

Log into FastPanel

  1. Open the FastPanel control panel
  2. Log in with your credentials

Go to CRON section

  1. In the main menu find “Scheduler” or “CRON” section
  2. Click “Add Task”

Configure task

Fill in the fields:

  • Command:
    /usr/bin/php8.2 /home/username/domains/yourdomain.com/flute cron:run
  • Minutes: * (every minute)
  • Hours: * (every hour)
  • Days of month: * (every day)
  • Months: * (every month)
  • Days of week: * (every day of week)

Check PHP path

  1. In FastPanel find the “PHP” section
  2. See which PHP version is used for your site
  3. Usually the path is: /usr/bin/php8.2 or /usr/bin/php8.3

Save task

  1. Click “Save”
  2. Make sure the task appears in the active list

In FastPanel CRON is usually configured very simply through the web interface.

Checking CRON Operation

After setting up CRON it’s important to make sure it works correctly.

1. Check in admin panel

Go to CRON statistics

  1. In the Flute admin panel find “System” section
  2. Find “CRON Statistics”

Check last execution

  1. Look at the time of last CRON execution
  2. It should update every minute
  3. Check task execution status

2. Check logs

Flute CMS logs

Check the log file:

storage/logs/cron.log

System logs

Linux:

# System CRON logs tail -f /var/log/cron # or tail -f /var/log/syslog | grep CRON

cPanel:

# Logs in cPanel are usually available in "Error Logs" section

3. Manual check

Execute command manually for testing:

# Go to Flute CMS folder cd /path/to/flute # Execute command php flute cron:run

If the command executes without errors, the configuration is correct.

Possible Problems and Solutions

CRON not executing

Causes:

  • Incorrect PHP path
  • Incorrect Flute CMS files path
  • CRON disabled in admin panel
  • Insufficient access permissions

Solution:

  1. Check paths in CRON command
  2. Make sure CRON is enabled in admin panel
  3. Check file access permissions
  4. Look at error logs

Errors in logs

Typical errors:

# PHP not found /usr/bin/php8.2: No such file or directory # File not found php: can't open file 'flute': No such file or directory # Insufficient permissions Permission denied

Solution:

  1. Find correct PHP path: which php or ls /usr/bin/php*
  2. Check Flute CMS path
  3. Set 755 permissions on Flute CMS folder

CRON executing too often

Problem: Getting many notifications or high load

Solution:

  1. Disable notifications in CRON panel settings
  2. Add >/dev/null 2>&1 at the end of command
  3. Check that task is set to execute every minute, not more often

CRON Optimization

Performance configuration

  1. Execution time limit:

    timeout 50 /usr/bin/php8.2 /path/to/flute/flute cron:run
  2. Run only when no other processes:

    flock -n /tmp/flute-cron.lock /usr/bin/php8.2 /path/to/flute/flute cron:run
  3. Logging with rotation:

    /usr/bin/php8.2 /path/to/flute/flute cron:run >> /path/to/logs/cron.log 2>&1
💡

Properly configured CRON significantly improves Flute CMS functionality and automates many important processes!