Skip to Content
Flute CMS v1.0.0 — Получить ключ доступа
GuidesCRON

Setting Up CRON for Flute CMS

CRON is a system task scheduler that automatically runs commands on a schedule. Flute CMS uses CRON to perform many background operations:

  • Game server monitoring — checking online status, server state, and player count
  • Cache cleanup — removing outdated data to maintain performance
  • Sending notifications — email newsletters, user alerts
  • Payment verification — automatic processing and confirmation of transactions
  • Other automated tasks — updating statistics, log rotation, etc.

Important! Without a configured CRON, many Flute CMS features will not work: servers will not update their online status, notifications will not be sent, and payments will not be verified automatically. CRON must run every minute for proper operation.

Enabling CRON in the Admin Panel

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

Log in to the admin panel

  1. Open your website and log in to the admin panel
  2. Make sure you have the required permissions:
    • admin.system (system administrator)
    • admin.boss (main administrator)

Go to general settings

  1. In the admin panel sidebar, under the “General” section, click on “General Settings”
  2. You will be on the “General Settings” tab

Enable CRON mode

  1. Scroll down to the “Optimization and Security” section
  2. Find the “CRON Mode” toggle and enable it
  3. After enabling, a “CRON Command” field will appear below — copy the command from this field, you will need it in the next step
  4. Save the settings

Enabling CRON in the admin panel

After enabling CRON mode in the admin panel, the system will stop executing background tasks on every page visit by users and will wait for calls through CRON. Therefore, it is important to set up CRON on the server immediately (next step), otherwise background tasks will stop executing.

Setting Up CRON on the Server

Command to execute: php flute cron:run

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

FastPanel

Log in to FastPanel

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

Go to the CRON section

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

Configure the 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 the week)

Check the PHP path

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

Save the task

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

In FastPanel, CRON is usually very easy to set up through the web interface.

Verifying CRON Operation

After setting up CRON, it is important to make sure it is working correctly.

1. Checking in the admin panel

Go to CRON statistics

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

Check the last execution

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

2. Checking 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 the "Error Logs" section

3. Manual verification

Run the command manually to verify:

# Navigate to the Flute CMS directory cd /path/to/flute # Execute the command php flute cron:run

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

Possible Issues and Solutions

CRON is not executing

Causes:

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

Solution:

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

Errors in logs

Common 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 the correct PHP path: which php or ls /usr/bin/php*
  2. Check the path to Flute CMS
  3. Set permissions to 755 on the Flute CMS directory

CRON is executing too frequently

Problem: Receiving too many notifications or high server load

Solution:

  1. Disable notifications in the CRON panel settings
  2. Add >/dev/null 2>&1 to the end of the command
  3. Make sure the task is set to run every minute, not more frequently

CRON Optimization

Performance tuning

  1. Execution time limit:

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

    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

A properly configured CRON significantly improves the functionality of Flute CMS and automates many important processes!