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
- Open your site and log into the admin panel
- Make sure you have the permissions:
admin.system
(system administrator)admin.boss
(chief administrator)
Go to general settings
- In the admin panel find the “Settings” section
- Go to “General Settings”
Enable CRON
- Find the “Enable CRON” setting
- Set the toggle to “Enabled”
- Save settings
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
FastPanel
Log into FastPanel
- Open the FastPanel control panel
- Log in with your credentials
Go to CRON section
- In the main menu find “Scheduler” or “CRON” section
- 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
- In FastPanel find the “PHP” section
- See which PHP version is used for your site
- Usually the path is:
/usr/bin/php8.2
or/usr/bin/php8.3
Save task
- Click “Save”
- 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
- In the Flute admin panel find “System” section
- Find “CRON Statistics”
Check last execution
- Look at the time of last CRON execution
- It should update every minute
- 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:
- Check paths in CRON command
- Make sure CRON is enabled in admin panel
- Check file access permissions
- 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:
- Find correct PHP path:
which php
orls /usr/bin/php*
- Check Flute CMS path
- Set 755 permissions on Flute CMS folder
CRON executing too often
Problem: Getting many notifications or high load
Solution:
- Disable notifications in CRON panel settings
- Add
>/dev/null 2>&1
at the end of command - Check that task is set to execute every minute, not more often
CRON Optimization
Performance configuration
-
Execution time limit:
timeout 50 /usr/bin/php8.2 /path/to/flute/flute cron:run
-
Run only when no other processes:
flock -n /tmp/flute-cron.lock /usr/bin/php8.2 /path/to/flute/flute cron:run
-
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!