---
title: "How to check if a cron job is running or ran"
url: "https://cronmissed.com/learn/check-if-a-cron-job-is-running.md"
canonical_url: "https://cronmissed.com/learn/check-if-a-cron-job-is-running"
last_updated: "2026-11-26"
type: "conceptual"
summary: "Tell whether a cron job started, is running now, finished and succeeded: the system log, pgrep, a timestamp file, a test line and a heartbeat check."
related: ["https://cronmissed.com/learn.md", "https://cronmissed.com/learn/cron-job-not-running.md", "https://cronmissed.com/learn/cron-logs.md", "https://cronmissed.com/learn/create-a-cron-job.md", "https://cronmissed.com/learn/cron-job-monitoring.md", "https://cronmissed.com/learn/start-and-finish-pings.md"]
---

# How to check if a cron job is running or ran

> **For AI agents:** the complete index of CronMissed pages is [llms.txt](https://cronmissed.com/llms.txt). Every page is also served as markdown at its URL plus .md.

Tell whether a cron job started, is running now, finished and succeeded: the system log, pgrep, a timestamp file, a test line and a heartbeat check.

Three different questions hide in this one: did cron start the job, is it running now, and did it succeed. The system log answers the first, `pgrep` answers the second, and only the job itself can answer the third. This page gives the command for each, and the way to stop checking by hand.

## How do you check that cron started the job?

Cron writes a line to the system log each time it starts a command. Search for your command in it:

```shell
grep CRON /var/log/syslog | tail -n 20
journalctl -u cron --since "1 hour ago"
```

On Debian and Ubuntu the log is `/var/log/syslog` when the system keeps one, or the journal, and the unit is called `cron`. On Fedora and Red Hat the unit is `crond` and the file is `/var/log/cron`. A line shows the user and the command that cron launched. It shows that the job started, not that it worked. [Where to find cron logs](https://cronmissed.com/learn/cron-logs.md) goes through each system.

## How do you check whether a job is running right now?

```shell
pgrep -af backup.sh
ps -eo pid,etime,cmd | grep '[b]ackup.sh'
```

`pgrep -af` lists the process ids and full command lines that match the name, and `etime` in the second form shows how long each one has been running. Two lines for one job mean two runs are overlapping; see [overlapping cron runs](https://cronmissed.com/learn/overlapping-cron-runs.md). The brackets in `[b]ackup.sh` stop `grep` from matching itself.

## How do you check that the job finished and succeeded?

Cron keeps no result. Make the job leave one. The simplest record is a file that is touched only when the work succeeded:

```crontab
30 2 * * * /usr/local/bin/backup.sh && touch /var/run/backup.last-ok
```

Read its age with `stat -c %y /var/run/backup.last-ok`. A file older than the schedule allows means the job did not finish its last run. The exit status of the last command is the same signal that [exit codes and failure signals](https://cronmissed.com/learn/exit-codes-and-failure-signals.md) describes.

## How do you test that cron runs a new job at all?

Temporarily set the schedule to every minute and have the job write a line to a file, as in [how to create a cron job](https://cronmissed.com/learn/create-a-cron-job.md). If the file grows once a minute, cron and the schedule are fine and the fault is in the real command. If it stays empty, check that the service is running with `systemctl status cron` and read [cron job not running](https://cronmissed.com/learn/cron-job-not-running.md).

## How do you stop checking by hand?

A log search tells you about the past only when you think to run it, and a job that never started leaves no line to find. A heartbeat check reverses it: the job reports each success, and an alert goes out when a report does not arrive on time. Add the request to the end of the line:

```crontab
30 2 * * * /usr/local/bin/backup.sh && curl -fsS --max-time 10 --retry 5 -o /dev/null https://ping.cronmissed.com/5f0c1b2e-7a3d-4c8e-9b61-2d4f8a7e3c10
```

Create a check with the same schedule and CronMissed records each run and alerts you when one is late or fails. [What is cron job monitoring?](https://cronmissed.com/learn/cron-job-monitoring.md) explains the three ways a job can fail, and [start and finish pings](https://cronmissed.com/learn/start-and-finish-pings.md) shows how to see a job that is running too long.

## Questions

### How can I tell if cron ran my job last night?

Search the system log for the command with `grep CRON /var/log/syslog` or `journalctl -u cron`. If the log has been rotated, look in the older files. The log proves the start, so a script that writes its own result is the better evidence.

### How do I check if the cron service is running?

Run `systemctl status cron`, or `systemctl status crond` on Fedora and Red Hat. A machine that was off at the scheduled time did not run the job, and cron does not catch up on missed runs.

### How do I know if a cron job ran twice?

Compare the process ids in the log lines for the job. Different ids mean separate runs. Two entries at the same time can also mean the line is in more than one crontab; see [where cron jobs are stored](https://cronmissed.com/learn/list-all-cron-jobs.md).

### Can I get an alert when a cron job does not run?

Yes. Have the job request a monitoring URL when it finishes. When the request is late, the check alerts you by email, Slack, Telegram or a webhook.

## Sources

- [crontab(5) manual page](https://man7.org/linux/man-pages/man5/crontab.5.html), read 26 November 2026

## Related pages

- [Cron job not running checklist](https://cronmissed.com/learn/cron-job-not-running.md)
- [Cron logs](https://cronmissed.com/learn/cron-logs.md)
- [Create a cron job](https://cronmissed.com/learn/create-a-cron-job.md)
- [Cron job monitoring](https://cronmissed.com/learn/cron-job-monitoring.md)
- [Start and finish pings](https://cronmissed.com/learn/start-and-finish-pings.md)

## Related

- [Cron monitoring explained: concepts and fixes](https://cronmissed.com/learn.md)
- [Cron job not running: a checklist by system](https://cronmissed.com/learn/cron-job-not-running.md)
- [Where to find cron logs and job output](https://cronmissed.com/learn/cron-logs.md)
- [How to create a cron job on Linux and Ubuntu](https://cronmissed.com/learn/create-a-cron-job.md)
- [What is cron job monitoring?](https://cronmissed.com/learn/cron-job-monitoring.md)
- [Start and finish pings for long-running jobs](https://cronmissed.com/learn/start-and-finish-pings.md)
