---
url: https://findutils.com/guides/cron-to-systemd-guide
title: "Cron to systemd: Convert Crontab to Timers and CronJobs"
description: "Convert a 5-field cron expression into a systemd timer pair and Kubernetes CronJob YAML in your browser. Six-field cron with seconds is rejected."
category: developer
content_type: guide
locale: en
read_time: 5
status: published
author: "codewitholgun"
published_at: 2026-08-27T08:20:00Z
updated_at: 2026-08-27T08:20:00Z
excerpt: "Paste a 5-field cron line, set a unit name and command, then copy systemd units and CronJob YAML. Conversion stays in your browser. The job does not run."
tag_ids: ["developer-tools", "cron", "systemd", "kubernetes", "timers"]
tags: ["Developer Tools", "Cron", "systemd", "Kubernetes", "Timers"]
primary_keyword: "cron to systemd"
secondary_keywords: ["cron to systemd timer", "convert crontab to OnCalendar", "cron to kubernetes cronjob", "systemd timer generator", "5 field cron converter"]
tool_tag: "cron-to-systemd"
related_tool: "cron-to-systemd"
related_tools: ["cron-to-systemd", "cron-expression-generator", "json-formatter", "regex-tester"]
og_image: "/images/content/guides/cron-to-systemd-timer-units.webp"
image_alt: "A five-segment schedule ring splits into a pair of systemd unit cards and a Kubernetes CronJob document silhouette."
---

A cron-to-systemd converter turns a 5-field crontab line into a systemd timer plus service unit, and into Kubernetes CronJob YAML. Paste the expression into the FindUtils [Cron to systemd](/developers/cron-to-systemd/) tool, set a unit name and command, then copy the files. Conversion runs in your browser. The tool does not run the job.

Six-field cron (with seconds) is rejected. Review `ExecStart` and the container command before you install anything.

## Why Convert Cron

systemd timers use `OnCalendar`, not crontab syntax. Kubernetes CronJob keeps the 5-field cron string. One converter that emits both saves a manual rewrite.

Convert cron when:

- **You are moving a crontab onto a host that uses systemd.** You need a `.timer` and a `.service`.
- **You are moving a schedule into a cluster.** You need a CronJob object.
- **You want to see `OnCalendar` next to the original line.** The mapping is easy to get wrong by hand.
- **Both day-of-month and day-of-week are set.** cron treats that as OR. systemd `OnCalendar` treats it as AND. The page warns on that case.

The honest limit: the YAML is a starting CronJob. Review image, name, and schedule before `kubectl apply`.

## How to Convert a Cron Expression

Use 5 fields: minute, hour, day-of-month, month, day-of-week.

### Step 1: Paste a 5-field expression

Open the FindUtils [Cron to systemd](/developers/cron-to-systemd/) tool. Examples: `*/5 * * * *` or `0 9 * * 1-5`. Presets cover every 5 minutes, weekdays at 09:00, hourly, and daily midnight.

### Step 2: Set a unit name and command

The unit name becomes the timer, service, and CronJob name. The command becomes `ExecStart` and the container command. Default command is `/usr/local/bin/your-command` if you leave it blank.

### Step 3: Copy systemd units

Copy the timer plus service pair. Install them on a host that uses systemd. Enable the timer after you review the command.

### Step 4: Copy CronJob YAML

Copy the YAML. Set a real image. Apply only after you read the schedule.

If you still need to *build* a cron line, use the [Cron Expression Generator](/developers/cron-expression-generator/) first, then convert it.

## Cron vs systemd OnCalendar vs Kubernetes CronJob

The same English schedule is not the same syntax in each system.

| Aspect | Crontab (5-field) | systemd timer | Kubernetes CronJob |
|--------|-------------------|---------------|--------------------|
| Schedule field | `m h dom mon dow` | `OnCalendar=` | `schedule:` 5-field cron |
| Seconds | Not in 5-field form | Yes, in `OnCalendar` | Not in standard CronJob |
| DOM + DOW both set | OR | AND | cron OR semantics |
| This converter | Input | Emits `.timer` + `.service` | Emits YAML |
| Runs the job | cron daemon | systemd | kube-controller |

Worked mappings from this converter:

- `*/5 * * * *` becomes `OnCalendar *-*-* *:00/5:00` and a CronJob schedule of that same cron string.
- `0 9 * * 1-5` becomes `OnCalendar Mon..Fri *-*-* 09:00:00` and CronJob `0 9 * * 1-5`.

## Practical Examples

### Example 1: Every 5 minutes on a VM

Paste `*/5 * * * *`. Set unit name `backup` and command `/usr/local/bin/backup.sh`. Copy the units. Enable the timer on the host.

### Example 2: Weekday morning report in a cluster

Paste `0 9 * * 1-5`. Copy CronJob YAML. Replace the image and command. Apply in the target namespace.

### Example 3: Catch the DOM + DOW warning

Paste `0 0 1 * 1`. Both day-of-month and day-of-week are set. cron fires on the 1st **or** on Monday. systemd `OnCalendar` needs both. Read the warning before you ship the timer.

## Common Mistakes

### Mistake 1: Pasting Quartz 6-field cron

A leading seconds field is rejected. Use 5 fields only.

### Mistake 2: Installing units without reading ExecStart

The command you type is copied into the service. A placeholder path will fail at runtime.

### Mistake 3: Assuming DOM + DOW match cron on systemd

That combination is OR in cron and AND in `OnCalendar`. Check the warning.

### Mistake 4: Applying YAML with the sample image still in place

The YAML is a starting point. Set image, name, and schedule first.

## Limits You Should Plan For

The converter accepts the 5-field form only. A sixth seconds field is an error, not a silent drop.

`OnCalendar` is a best-effort mapping of the fields you typed. Review the timer after you copy it, especially when the expression uses lists, ranges, or both day fields.

Kubernetes CronJob YAML from this page is a starting object. It does not set resource limits, a real container image, or a namespace. Fill those in before apply.

Conversion does not talk to systemd or to a cluster. Nothing is installed until you copy the files to a host you control.

## Tools Used in This Guide

- **[Cron to systemd](/developers/cron-to-systemd/)** — Convert 5-field cron to systemd units and CronJob YAML
- **[Cron Expression Generator](/developers/cron-expression-generator/)** — Build and validate cron expressions
- **[JSON Formatter](/developers/json-formatter/)** — Pretty-print JSON when you inspect related configs
- **[Regex Tester](/developers/regex-tester/)** — Test field patterns while you edit expressions

## FAQ

**Q: Is cron to systemd free?**
A: Yes. FindUtils Cron to systemd is free, with no signup. Conversion runs in your browser.

**Q: Is this 5-field cron?**
A: Yes. Six-field expressions with seconds are rejected.

**Q: Does it run the job?**
A: No. It emits unit files and YAML.

**Q: Can I use Quartz 6-field cron?**
A: No. This converter is 5-field only.

**Q: Is the YAML valid?**
A: It is a starting CronJob. Review image, name, and schedule before apply.

**Q: What about 0 9 * * 1-5?**
A: `OnCalendar` is `Mon..Fri *-*-* 09:00:00`. The CronJob uses schedule `0 9 * * 1-5`.

**Q: Do I need an account?**
A: No. Paste the expression and copy the files.

## Next Steps

- Build the cron line first with the [Cron Expression Generator](/developers/cron-expression-generator/)
- Read the [cron expression generator guide](/guides/cron-expression-generator-guide/)
- Validate YAML-shaped config with the [YAML Validator](/developers/yaml-validator/)
- Browse the [complete guide to online developer tools](/guides/complete-guide-to-online-developer-tools/)
