scheduled-jobs

Registers and schedules recurring OrangeHRM console commands via Crunz-based cron tasks.

Updated Jul 23, 2026
One-click install
npx skills add https://github.com/snow-gift111/orangehrm-ai-sdlc-capstone --skill scheduled-jobs-snow-gift111
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: scheduled-jobs
Source: https://github.com/snow-gift111/orangehrm-ai-sdlc-capstone/tree/main/.agents/skills/scheduled-jobs
Command: npx skills add https://github.com/snow-gift111/orangehrm-ai-sdlc-capstone --skill scheduled-jobs-snow-gift111

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Setting up recurring background tasks in OrangeHRM requires understanding how the framework's Crunz-based scheduler connects host-level cron, plugin configuration interfaces, and console commands — a pattern that is easy to get wrong, leading to tasks that silently never run. ## Core Features & Use Cases - Task Registration: Implement SchedulerConfigurationInterface on a plugin's configuration class to register Task objects with cron expressions via the Schedule value object. - Fluent Scheduling API: Use Crunz methods like ->dailyAt(), ->everyFiveMinutes(), ->weekdays(), and ->timezone() to define when tasks run, with UTC as the default evaluation timezone. - Execution Logging & Debugging: Every run is recorded in the ohrm_task_scheduler_log table with command, input, timestamps, and exit status, plus error traces in src/log/scheduler.log. - Use Case: Schedule an LDAP user sync command to run every N hours only when LDAP is enabled in config, mirroring the built-in LDAPAuthenticationPluginConfiguration pattern. ## Quick Start Add a scheduled task that runs my widget:cleanup console command every day at 02:00 UTC using the OrangeHRM scheduler.

Frequently Asked Questions about scheduled-jobs

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I schedule a recurring background task in OrangeHRM?

Implement SchedulerConfigurationInterface on your plugin's configuration class and add a schedule() method that calls $schedule->add(new CommandInfo('command:name')) with a Crunz fluent schedule like ->dailyAt('02:00'). The host cron runs orangehrm:run-schedule every minute to execute due tasks.

How to set up the cron entry for OrangeHRM scheduled jobs?

Add one system cron line running every minute: * * * * * www-data php /path/to/orangehrm/bin/console orangehrm:run-schedule. Operators configure this once; the framework then picks up all tasks registered by plugins automatically.

Why is my OrangeHRM scheduled task not running?

Common causes include a missing host cron entry, the plugin config not implementing SchedulerConfigurationInterface, a conditional schedule() check failing, or UTC timezone confusion with dailyAt(). Run orangehrm:run-schedule --verbose manually and check src/log/scheduler.log and ohrm_task_scheduler_log.

Does OrangeHRM scheduling use UTC or local time?

Scheduling is evaluated in UTC by default, so ->dailyAt('09:00') runs at 09:00 UTC. To run at a specific local time, chain ->timezone('Asia/Colombo') on the task so the due-time check uses that timezone.

How do I pass arguments to a scheduled console command?

Pass an ArrayInput as the second argument to CommandInfo, for example new CommandInfo('widget:cleanup', new ArrayInput(['--days' => '30'])). The raw parameters are recorded in the input column of ohrm_task_scheduler_log for auditing.

What happens when a scheduled task throws an exception?

The exception is caught, logged to src/log/scheduler.log, and the task is recorded with a non-zero failure status in ohrm_task_scheduler_log. Other tasks in the same run-schedule invocation still execute normally.