# 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 &gt;&gt; /dev/null 2&gt;&amp;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

<table id="bkmrk-command-schedule-des"><tbody><tr><td>Command</td><td>Schedule</td><td>Description</td></tr><tr><td>`iplists:generate`</td><td>Every 10 minutes</td><td>Generate updated IP lists from the DB</td></tr><tr><td>`clamav:generate-signatures`</td><td>Hourly at :50</td><td>Generate ClamAV signature files</td></tr><tr><td>`agents:check-notifications`</td><td>Every minute</td><td>Check agent status and send alerts</td></tr><tr><td>`autodelete:run`</td><td>Daily at 08:00</td><td>Run AutoDelete cleanup job</td></tr><tr><td>`config:sync-storage`</td><td>Every 5 minutes</td><td>Sync configuration files from disk</td></tr><tr><td>`blocklist:resolve-ptr`</td><td>Every 10 minutes</td><td>Resolve PTR records in batches</td></tr><tr><td>`blocklist:resolve-geodata`</td><td>Every 10 minutes</td><td>Resolve ASN/Country data in bulk</td></tr><tr><td>`unblocks:cleanup`</td><td>Every 5 minutes</td><td>Cleanup old unblock requests</td></tr><tr><td>`phishlist:generate`</td><td>Every 30 minutes</td><td>Regenerate phishing domain list</td></tr><tr><td>`mailfromfilters:generate`</td><td>Hourly</td><td>Regenerate mailfromfilters.cf</td></tr><tr><td>`execution:dispatch`</td><td>Every minute</td><td>Dispatch queued execution rules</td></tr><tr><td>`DataFeedJob (callback)`</td><td>Every minute</td><td>Dispatch data feed jobs for active feeds</td></tr></tbody></table>

These scheduled commands are critical for keeping data up-to-date, automating cleanup, syncing feeds and configurations, and dispatching jobs to agents or queues.