Scheduled Tasks / Cron and Supervisor settings
⏱️ Scheduled Commands (Cron)
Scheduled tasks are defined in routes/console.php
and executed using Laravel's schedule:run
command. They can be run via a cron shell script or with a process manager like Supervisor.
Shell Cron Example:
#!/bin/bash
cd "$(dirname "$0")"
php artisan schedule:run >> /dev/null 2>&1
Supervisor Setup (Recommended)
Service file: supervisor.service
[Unit]
Description=Supervisor process control system for UNIX
After=network.target
[Service]
ExecStart=/usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf
ExecStop=/usr/bin/supervisorctl $OPTIONS shutdown
ExecReload=/usr/bin/supervisorctl -c /etc/supervisor/supervisord.conf $OPTIONS reload
Restart=on-failure
RestartSec=50s
Program config: /etc/supervisor/conf.d/cfm.conf
[program:cfm]
command=php /home/cfm/artisan queue:work redis --memory=2048 --tries=3 --timeout=600
user=cfm
autostart=true
autorestart=true
numprocs=2
redirect_stderr=true
stdout_logfile=/var/log/supervisor/cfm.log
Scheduled Commands
Command | Schedule | Description |
iplists:generate |
Every 10 minutes | Generate updated IP lists from the DB |
clamav:generate-signatures |
Hourly at :50 | Generate ClamAV signature files |
agents:check-notifications |
Every minute | Check agent status and send alerts |
autodelete:run |
Daily at 08:00 | Run AutoDelete cleanup job |
config:sync-storage |
Every 5 minutes | Sync configuration files from disk |
blocklist:resolve-ptr |
Every 10 minutes | Resolve PTR records in batches |
blocklist:resolve-geodata |
Every 10 minutes | Resolve ASN/Country data in bulk |
unblocks:cleanup |
Every 5 minutes | Cleanup old unblock requests |
phishlist:generate |
Every 30 minutes | Regenerate phishing domain list |
mailfromfilters:generate |
Hourly | Regenerate mailfromfilters.cf |
execution:dispatch |
Every minute | Dispatch queued execution rules |
DataFeedJob (callback) |
Every minute | Dispatch data feed jobs for active feeds |
These scheduled commands are critical for keeping data up-to-date, automating cleanup, syncing feeds and configurations, and dispatching jobs to agents or queues.
No Comments