System

Scheduler

Scheduler manages automated background tasks that run on a schedule — account expiry processing, usage resets, expiry reminders, and report generation. Each job can be enabled, configured, and triggered manually from the admin panel.

'alt' => 'Dashboard overview', 'caption' => 'The default Kiwire dashboard layout', 'screenshot' => true, 'class' => '', ]) Drop images into: public/assets/img/docs/{page}/{filename} --}}
Image not uploaded yet public/assets/img/docs/scheduler/overview.png
Scheduler — list of scheduled jobs with status, last run, and manual trigger controls.

What It Does

Kiwire uses Laravel's task scheduler to run recurring jobs automatically. The scheduler checks which jobs are due on every cron tick and dispatches them to the queue. Jobs run in the background via queue workers — they do not block the web server.

Built-In Scheduled Jobs

JobFrequencyDescription
ProcessExpiredAccounts Hourly Scans all WiFi user accounts and deactivates those whose date_expiry has passed. Moves their status to expired.
ResetMonthlyUsage Monthly (1st of month) Resets session time and quota counters to zero for users assigned to profiles with auto-reset enabled. Allows monthly-plan users to start fresh each billing cycle.
SendAccountExpiryReminders Daily Sends email reminders to WiFi users whose accounts are approaching expiry (configurable: 7 days, 3 days, and 1 day before). Requires the SMTP connector to be configured.
GenerateDailyReport Daily (configurable time) Generates a summary report of the previous day's WiFi usage — total sessions, bandwidth, new registrations — and emails it to the configured recipients.

Job Configuration

Each job has its own configuration panel:

  • Enable / Disable — toggle whether the job runs on schedule. Disabled jobs are skipped but can still be triggered manually.
  • Run Time / Frequency — for jobs that support it, configure the exact time or interval (e.g., run GenerateDailyReport at 07:00 each morning).
  • Email Recipients — for report and notification jobs, specify one or more email addresses to receive the output.

Last Run Status

The grid shows the last run information for each job:

  • Last Run At — exact timestamp of the most recent execution.
  • Duration — how long the job took to complete (ms or seconds).
  • ResultSuccess or Failed. Failed jobs show the error message in a tooltip.

Manual Trigger

Click Run Now on any job to execute it immediately without waiting for the next scheduled run. The job is dispatched to the queue and the status updates when it completes. Useful for testing a job after configuration changes or for running an off-cycle expiry sweep.

Manually triggered jobs run through the same queue workers as background jobs. If the queue is busy or the worker is not running, the job will wait in the queue.

Server Setup Requirement

The Laravel scheduler requires a single cron entry on the server to dispatch scheduled jobs every minute. Add the following to your server's crontab:

* * * * * cd /path/to/kiwire && php artisan schedule:run >> /dev/null 2>&1

Without this cron entry, no scheduled jobs will run automatically. The Scheduler UI will still function for manual triggers, but all automatic scheduling is driven by this cron.

Verify the cron is running after deployment by checking whether ProcessExpiredAccounts shows a recent Last Run At timestamp. A missing or broken cron is the most common cause of accounts not expiring on time.

Required Permissions

view-scheduler · update-scheduler