⏱️ Defining When Semaphore Runs a Scheduled Task

Each entry under semaphoreui_setup_projects_schedules defines an automated task that Semaphore will run on a recurring schedule.

The cron field specifies when the task should execute, using a standard 5‑field UNIX cron expression.

πŸ“Œ Example

semaphoreui_setup_projects_schedules:
  "Home Lab":
    - name: "Nightly Semaphore Backup"
      template: "Backup Semaphore Database"
      cron: "0 3 * * *"
      enabled: true

    - name: "Weekly Cert Rotation"
      template: "Request Certificates for all hosts"
      cron: "0 4 * * 0"
      enabled: true

🧩 What the cron Field Represents

The cron variable defines the schedule using this format:

Field Meaning Example
minute 0–59 0
hour 0–23 3
day of month 1–31 *
month 1–12 *
day of week 0–6 (0 = Sunday) 0

Semaphore accepts standard cron syntax, and the role passes this value directly to the Semaphore API when creating the schedule.


πŸ•’ Interpreting Your Examples

Nightly Semaphore Backup

cron: "0 3 * * *"

Runs every day at 03:00.

Weekly Cert Rotation

cron: "0 4 * * 0"

Runs every Sunday at 04:00.


πŸ› οΈ How the Role Uses cron

When the playbook runs:

No additional transformation or validation is performed by the roleβ€”your cron string must be valid UNIX cron syntax.

Absolutely β€” here’s a clean, scannable Cron Cheat Sheet that matches the tone and structure of your existing Runbook page. It drops in neatly right after the explanation of the cron field.


🧭 Cron Cheat Sheet

A quick reference for contributors defining schedules under semaphoreui_setup_projects_schedules.

⭐ Common Patterns

Schedule Cron Expression Meaning
Every minute * * * * * Runs once per minute
Every 5 minutes */5 * * * * Runs every 5 minutes
Hourly 0 * * * * At minute 0 of every hour
Daily at 03:00 0 3 * * * Runs every day at 03:00
Daily at midnight 0 0 * * * Runs every day at 00:00
Weekly (Sunday) at 04:00 0 4 * * 0 Runs every Sunday at 04:00
Monthly (1st) at 02:00 0 2 1 * * Runs on the 1st of each month
Yearly (Jan 1) at 00:00 0 0 1 1 * Runs once per year

πŸ”’ Field Reference

Field Allowed Values Notes
Minute 0–59 */N for intervals
Hour 0–23 24‑hour format
Day of Month 1–31 * for any day
Month 1–12 Or names: JAN, FEB, etc.
Day of Week 0–6 0 = Sunday

πŸ§ͺ Useful Tricks