Cron Jobs
ColibriPlus requires scheduled tasks (cron jobs) to run in the background for essential maintenance operations like database cleanup, temporary file removal, and other automated processes.
Since ColibriPlus is powered by Laravel, it uses Laravel's Task Scheduling system under the hood. This means any feature from the Laravel scheduling ecosystem is fully supported.
How It Works
Instead of creating multiple cron entries on your server, Laravel allows you to define all scheduled tasks within the application itself. You only need a single cron entry on your server that runs Laravel's scheduler every minute. The scheduler then determines which tasks need to run based on their defined schedule.
What Gets Scheduled
ColibriPlus uses cron jobs for the following background tasks:
- Database cleanup - Removes expired sessions, old tokens, and stale records
- Temporary file cleanup - Clears temporary uploads and cached files
- Queue health monitoring - Ensures background jobs are processed correctly
- Other maintenance tasks - Various housekeeping operations required by the application
Setup
To activate the scheduler, you need to add a single cron entry to your server. Open your server's crontab:
crontab -eAdd the following line:
* * * * * cd /path/to/your/colibriplus && php colibri schedule:run >> /dev/null 2>&1Important
Replace /path/to/your/colibriplus with the actual path to your ColibriPlus installation directory.
This entry tells the system to run the Laravel scheduler every minute. The scheduler will then check if any tasks are due and execute them automatically.
Verifying the Setup
To confirm your scheduled tasks are registered and working, you can list all scheduled tasks:
php colibri schedule:listThis command will display a table with all registered tasks, their frequency, and next run time.
You can also run the scheduler manually to verify everything works:
php colibri schedule:runLogging
By default, the cron output is discarded (>> /dev/null 2>&1). If you want to log the scheduler output for debugging purposes, you can redirect it to a log file:
* * * * * cd /path/to/your/colibriplus && php colibri schedule:run >> /path/to/your/colibriplus/storage/logs/cron.log 2>&1Check the log file for any errors:
tail -f storage/logs/cron.logTroubleshooting
Cron Not Running
- Make sure the cron service is running on your server:
sudo systemctl status cron- Verify your crontab entry is saved:
crontab -l- Check that the path to your ColibriPlus installation is correct
- Ensure
phpis accessible from the cron environment. If not, use the full path to PHP:
* * * * * cd /path/to/your/colibriplus && /usr/bin/php colibri schedule:run >> /dev/null 2>&1Permission Issues
Make sure the cron job runs under a user that has the correct permissions to access the ColibriPlus files. Typically this should be the same user that owns the application files (e.g., www-data).
sudo crontab -u www-data -eOfficial Documentation
For more details on task scheduling and advanced configuration, refer to the official Laravel Task Scheduling documentation.
