Cron to systemd

Convert a 5-field cron schedule into systemd timer and service units plus a Kubernetes CronJob draft. Review timezone and day-field semantics before use.

Reviewed by Olgun Ozoktas

Conversion runs in the browser. Analytics and ads may load on the page.

5 fields: minute hour day-of-month month day-of-week. Example: */5 * * * * or 0 9 * * 1-5.

OnCalendar: *-*-* *:00/5:00

systemd units

# converted.timer
[Unit]
Description=Timer converted from cron */5 * * * *
Requires=converted.service

[Timer]
OnCalendar=*-*-* *:00/5:00
AccuracySec=1s
Persistent=true
Unit=converted.service

[Install]
WantedBy=timers.target

# converted.service
[Unit]
Description=Service started by converted.timer

[Service]
Type=oneshot
ExecStart=/usr/local/bin/your-command

Kubernetes CronJob

apiVersion: batch/v1
kind: CronJob
metadata:
  name: converted
spec:
  schedule: "*/5 * * * *"
  concurrencyPolicy: Forbid
  successfulJobsHistoryLimit: 3
  failedJobsHistoryLimit: 1
  jobTemplate:
    spec:
      template:
        spec:
          restartPolicy: OnFailure
          containers:
            - name: converted
              image: busybox:1.36
              command:
                - /bin/sh
                - -c
                - "/usr/local/bin/your-command"

How to convert cron

  1. Paste a 5-field expression

    Example: */5 * * * * or 0 9 * * 1-5.
  2. Set a unit name and command

    These become the timer/service names and the CronJob command.
  3. Copy systemd units

    Copy the timer plus service pair.
  4. Copy CronJob YAML

    Review image and command before apply.

Common Use Cases

Server Timer Migration

Create a systemd timer and service pair from a familiar 5-field cron schedule.

Kubernetes Job Draft

Create a CronJob YAML starting point with the same schedule and command.

Schedule Review

Compare the source cron string with the generated OnCalendar value before migration.

Unit Name Cleanup

Replace unsupported characters in a draft unit name, then review the different systemd and Kubernetes naming rules.

Why convert cron

systemd timers use OnCalendar, not crontab syntax. Kubernetes CronJob uses the 5-field cron string. This page emits both from one expression. Review ExecStart and the container command before you install the units. Conversion stays in your browser. Analytics or ads on the page may still load.

FindUtils Cron to systemd converts a 5-field cron expression into a systemd timer and service pair. It also creates a Kubernetes CronJob YAML draft from the same schedule, unit name, and command.

The systemd output uses OnCalendar, Persistent=true, and AccuracySec=1s. The Kubernetes output uses a busybox starting image, a shell command, Forbid concurrency, and OnFailure restart behavior.

Conversion runs in your browser and does not install or start anything. Build a source schedule with the Cron Expression Generator, and inspect pattern fragments with the Regex Tester when required.

How it compares

systemd timers can recover missed runs with Persistent=true, while Kubernetes CronJobs run containers under cluster rules. FindUtils gives both starting files, but it cannot choose deployment policy, timezone, credentials, or the correct application image.

Use the JSON Formatter for JSON configuration output. The CronJob from this tool is YAML and still needs a Kubernetes-aware review.

Cron Migration Tips

  • Use a 5-field cron expression. Six-field Quartz expressions and special names such as @daily are not supported.
  • Check any schedule that sets both day-of-month and day-of-week because cron and systemd use different logic.
  • Review the system timezone before you install the timer or apply the CronJob.
  • Replace the generated busybox image and command with the image that contains your application job.
  • Test the command separately before you enable the timer.

Frequently Asked Questions

Does it accept 5-field cron expressions?

Yes. FindUtils accepts the standard 5-field minute, hour, day, month, and weekday form. The expression */5 * * * * becomes a five-minute systemd calendar and the same CronJob schedule.

Does it run the job?

No. The tool emits systemd unit text and a Kubernetes YAML draft. It does not install, enable, apply, or execute either output.

What about 0 9 * * 1-5?

FindUtils converts it to OnCalendar Mon..Fri *-*-* 09:00:00. The CronJob keeps the schedule 0 9 * * 1-5.

Can I use Quartz 6-field cron?

No. This converter accepts the 5-field cron form only. It rejects a 6-field expression that includes seconds.

Is the generated YAML ready to apply?

It is a starting CronJob draft. Review the image, command, resource name, schedule, timezone, credentials, and cluster policy before you apply it.

Does it support @daily or @reboot?

No. Enter a standard 5-field cron expression. Special names such as @daily and @reboot are not supported.

Which timezone does the output use?

The generated files do not set a timezone. The target system or cluster configuration controls when the schedule runs.

Why is there a day-of-month and day-of-week warning?

Cron treats restricted day-of-month and day-of-week fields as OR. systemd OnCalendar combines them as AND, so the converted timer can run on different dates.

Is the generated container image ready for my job?

No. The YAML uses busybox:1.36 as a starting image. Replace it with an image that contains your command, runtime, and dependencies.

Does the timer include missed-run recovery?

Yes. The generated timer includes Persistent=true. systemd can start a missed timer after the system becomes active again.

Rate This Tool

0/1000

Get Weekly Tools

Suggest a Tool