IN PROGRESS
Technical summary
NEXUS Cronjobs is the server's single scheduling hub: it discovers jobs declared in each active plugin's cronjob.json, dispatches ticks via soft-cron (worker.php/cron.php/run_cron) and schedules custom CLI commands through an allowlist. It runs via nx_secure_exec_status and creates tasks from job runs.
Executed scope
- Plugin registration (
registerTab('nexus-cronjobs','Cronjobs','clock',tab.php,'Admin & Ops')+registerDoc) andcronjob.jsonas a declarative job manifest (same spirit asfastr.json). - 7 API actions:
cronjobs_list(catalog + custom + plugin_catalog + stats),cronjobs_save(schedule edited via functions.save),cronjobs_run(on-demand run),cronjobs_custom_{save,delete}(CLI job CRUD) andcronjobs_runs/cronjobs_tick(history and soft-cron dispatcher). - Persistence via DB config (no own tables):
plugin.cronjobs.jobs(custom, upsert),plugin.cronjobs.runs(history, max 80) andplugin.cronjobs.meta. - Security and allowlist:
cronjobs_resolve_command()validates the path against(?^plugins/[a-z0-9_-]+/.+\.php$ | cron/*.php | worker.php$)viarealpath, rejects../null/space and confirms the prefix stays inside root. - Workers/cron (soft-cron):
cronjobs_tick()iterates jobs withtick:truecallingfunctions.check, thencronjobs_run_custom_due()fires custom jobs whosenext_run <= nowand reschedules (cronjobs_calc_next_run: hourly/daily/weekly/monthly); production recommends an hourly crontab onworker.php(orcron.php/run_cron). - Execution:
cronjobs_exec_custom()andcronjobs_run_discovered()resolve command→path and run vianx_secure_exec_status([phpCli, $path])(PHP bin fromcronjobs_php_cli), log the result incronjobs_run_logand updatelast_run/last_status/next_run. - UI (
tab.php, 567 lines, AlpinecronjobsApp()): header withclockicon + crontab recommendation badge; "Production" callout; stat cards (Active/Next 24h/24h failures/Last tick); 3 tabs — Jobs (manifest catalog, plugin filter, active/off badges), Custom (CLI CRUD with plugin + job picker → hub-resolved path, frequency/time schedule) and History (paginated runs with ok/error status). - Integrations: Backup, Email OSINT, Pipeline Control and worker plugins expose jobs via
cronjob.json; the hub is the single orchestrator (no duplicate scheduling per plugin).
Stack and tools
- PHP 8 (backend, no framework) + MySQL 8 (
admin_configsstore) nx_secure_exec_statusfor CLI jobs with resolved PHP bin (/usr/bin/php, fallbacks/usr/bin/php8.x)- OS crontab scheduling
worker.php/cron.php/run_cron(soft-cron; no built-in daemon) - Alpine.js + Tailwind (
tab.php, no assets/ or design.css) - Internal Plugin API (PluginManager tabs/actions + declarative
cronjob.json)
Operational tags
- Cronjobs
- Scheduling
- Soft-cron
- Tick
- Worker
- Custom CLI
- NEXUS Plugin
Operational result
- Declarative discovery: each plugin exposes jobs in
plugins/<slug>/cronjob.json; the hub scans only active plugins and builds a unified, ID-deduplicated catalog. - Soft-cron with tick + custom:
cronjobs_tick()runs checks oftick:truejobs (backup, email_osint, pipeline) and fires custom jobs by due-time; schedules supporthourly|daily|weekly|monthly+HH:MM. - Security allowlist: no path is typed by the user — a picker lists plugin + job/CLI and the hub resolves the PHP via
realpathagainstplugins/*/…,cron/*.phpandworker.php. - Isolated execution: scripts run via
nx_secure_exec_status(no shell) with a resolved PHP binary, captured output and run logging. - History and stats: up to 80 runs in
plugin.cronjobs.runs+ stats (active, next 24h, 24h failures, last tick); plugins withoutcronjob.jsonshow as "no CLI". - Custom CLI from the panel: create/edit/delete jobs without touching the server — the path is resolved by the hub from the selected plugin.
GitHub progress (issues)
Real-time panel with latest repository issues.
live feed
open issues on GitHubcarregando andamento...
não foi possivel carregar as issues agora. abra no github pelo link acima.
Real results
Advanced scheduled task manager and background cron execution system. Enables configuring standard cron expressions, tracking execution histories, auditing logs and runtimes, and automating scheduled maintenance across the NEXUS ecosystem.
Architecture and organization
- PHP 8
- MySQL 8
- Alpine.js
- Tailwind CSS
- Nix crontab
- Plugin NEXUS
Execution and operations
The project follows reproducible execution flow with technical validation in production-like environments.
Screenshots
Talk about this project
Apply this implementation pattern in your environment and accelerate delivery with technical consistency.