User

Visual Cron Builder + Run History

Schedule commands with a friendly UI instead of cryptic cron syntax, and see the output, exit code, and duration of every past run.

Last updated 1775692800
  • Limitations
  • Troubleshooting
  • Opterius Panel includes a visual cron builder that lets you schedule recurring tasks without memorising cron syntax. Every run is captured automatically — you get the exit code, duration, and complete stdout/stderr of the last 20 executions for every job.

    This is one of the most-requested features by hosting customers and the most painful gap in cPanel: cron jobs in cPanel run silently, and when something breaks you have no way to see what happened.

    What the Visual Builder Does

    The cron builder gives you three ways to define a schedule:

    1. Quick presets — single-click buttons for the most common patterns: every minute, every 5/15/30 minutes, hourly, daily, weekly, monthly.
    2. Custom fields — five separate input boxes (minute, hour, day, month, weekday) that accept the standard cron syntax.
    3. Plain-English preview — as you type, the builder shows what your schedule actually means in human language: "Every Monday at 03:00", "Every 15 minutes", "On day 1 of every month at midnight".

    The plain-English preview updates live as you change any field, so you can verify your schedule is correct before saving.

    Creating a Cron Job

    1. Open Cron Jobs in the sidebar.
    2. Click Add Cron Job.
    3. Pick the account that should own the job.
    4. Choose a schedule:
      • Click a preset, or
      • Type values into the five fields directly
    5. Enter the command to run. Use absolute paths — cron does not have your shell's $PATH:
      /usr/bin/php /home/youruser/example.com/public_html/cron.php
      
    6. (Optional) Enter a description so you remember what the job does. This is shown in the cron list and on the job detail page.
    7. Click Add Cron Job.

    Run History

    Every cron job has a detail page showing the last 20 runs. To open it, click the job's name (or its description if you set one) in the cron list.

    For each run you see:

    • Status dot — green for success (exit code 0), red for failure (any other exit code)
    • Started at — exact timestamp + relative time ("3 minutes ago")
    • Duration — how long the command took to run, in milliseconds
    • Exit code — the integer the command returned to cron
    • Click to expand — reveals the full stdout and stderr output captured during the run

    This is invaluable when debugging:

    • A job that "isn't working" but cron says it ran → check stderr to see why
    • A job that's running too long → check the duration trend
    • A job that started failing recently → compare a recent failure against a known successful run

    How It Works Under the Hood

    When you create a cron job, the panel writes it to the system user's crontab via the agent. But instead of writing your command directly, it wraps it in a small bash runner script:

    */5 * * * * /usr/local/bin/opterius-cron-runner 42 'php /path/to/script.php'
    

    The wrapper script (/usr/local/bin/opterius-cron-runner):

    1. Records the start time
    2. Runs your command, capturing stdout and stderr separately
    3. Records the end time and exit code
    4. POSTs all of this to the panel's /api/cron/report endpoint

    The panel stores the result in the database, keeping the last 50 runs per job (older runs are pruned automatically). The wrapper exits with the same exit code your command returned, so cron sees the job as successful or failed normally.

    The runner script is installed automatically the first time you create a cron job — you don't need to do anything.

    Quick Reference

    Preset → Cron Expression

    Preset Cron expression Plain English
    Every minute * * * * * Every minute
    Every 5 minutes */5 * * * * Every 5 minutes
    Every 15 minutes */15 * * * * Every 15 minutes
    Every 30 minutes */30 * * * * Every 30 minutes
    Hourly 0 * * * * Every hour at minute 0
    Daily 0 0 * * * Every day at midnight
    Weekly (Sunday) 0 0 * * 0 Every Sunday at midnight
    Monthly (1st) 0 0 1 * * On day 1 of every month at midnight

    Custom Field Examples

    Goal Expression
    Every weekday at 9 AM 0 9 * * 1-5
    Every 15 minutes during business hours */15 9-17 * * *
    Twice a day (midnight and noon) 0 0,12 * * *
    Every 6 hours 0 */6 * * *
    First Monday of every month at 3 AM 0 3 * * 1 (approximation)

    Limitations

    • Output capture is limited to 64 KB per run for both stdout and stderr. Longer output is truncated. If your script produces megabytes of output, redirect it to a file inside your home directory and only print a summary to stdout.
    • The wrapper script only runs for new cron jobs. Cron jobs created before the panel was upgraded will still run, but their output will not be captured. To enable history for old jobs, delete and re-create them through the panel.
    • History is stored in the panel database, not on the agent server. If you have multiple panel installs they each track their own history.

    Troubleshooting

    My cron job runs but the history shows no entries. The wrapper script may have failed to install. SSH to your server and check that /usr/local/bin/opterius-cron-runner exists and is executable. If not, re-create the cron job from the panel — the agent reinstalls the script on each cron create.

    The history shows my job ran but stdout is empty. That just means your command produced no output. This is normal — most well-behaved commands print nothing on success. If you want to confirm the job ran, add a line like echo "Job ran at $(date)" to your script.

    I see "Network error" in the panel logs. The wrapper POSTs results back to the panel via curl. If your panel is hosted at a non-standard URL, make sure /etc/opterius/agent.conf includes a panel_url=... line pointing to the correct location.