> ## Content Index
> Fetch the complete content index at: https://linuxhandbook.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# How to Check Crontab logs in Linux
- URL: https://linuxhandbook.com/check-crontab-logs/
- Published: 2022-09-12T05:19:21.000Z
- Updated: 2025-03-05T02:59:07.000Z
- Description: Wondering if the cronjob ran successfully or not? Stop wondering. Just check the cron logs. Here's who to do that.
- Author: Abhishek Prakash
- Tags: Tips

As a Linux user, you are probably already familiar with [crontab](https://linuxhandbook.com/crontab/). You can automate tasks by running commands and scripts at a predefined schedule. Want to automatically take backups? Crontab is your friend.

I am not going into the usage of crontab here. My focus is on showing you the different ways to check crontab logs. 

It helps investigate whether your cronjobs ran as scheduled or not.

## Method 1: Check the syslog for crontab logs

As per the [Linux directory hierarchy](https://linuxhandbook.com/linux-directory-structure/), the `/var/log` directory in Linux stores logs from the system, services, and running applications.

While the cron logs are also in this directory, there is no standard file for these logs. Different distributions keep them in different files.

For **Debian-based distributions**, the file `/var/log/syslog` contains the logs from the cron job execution and should be consulted in case your cron jobs are not working:

```
cat /var/log/syslog | grep -w 'cron'
```

![checking crontab logs in syslogs](https://linuxhandbook.com/content/images/2022/09/syslog-showing-crontab-logs.png)

You will see all cron jobs listed on your terminal when the above command is run. The [grep command](https://linuxhandbook.com/what-is-grep/) will filter the cron related messages apart from the rest.

For **RedHat-based distros**, the cron logs have dedicated file `/var/log/cron`. 

In both cases, you will probably need to specify the `sudo` keyword or use the root account to access the logs.

[Beginner’s Guide to Syslogs in Linux \[Real World Examples\]The good old syslogs are still relevant in the systemd age of journal logs. Learn the basics of logging with syslogd in this guide.![](https://linuxhandbook.com/content/images/size/w256h256/2021/08/Linux-Handbook-New-Logo.png)Linux HandbookLHB Community![](https://linuxhandbook.com/content/images/2022/03/logging-with-syslogd-1.png)](https://linuxhandbook.com/syslog-guide/)

## Method 2: Use a custom log file (recommended)

Using a separate custom file for logging cron jobs is a recommended practice. 

For this, you can configure ‘rsyslog’ to forward cron logs. [Rsyslog](https://www.rsyslog.com/?ref=linuxhandbook.com) is a Linux service that has features similar to Syslog logging. 

Simply [create a file](https://linuxhandbook.com/create-file-linux/) `cron.log` under the directory `/var/log`:

```
touch /var/log/cron.log
```

Now open the file `/etc/rsyslog.d/50-default.conf` for editing:

```
nano /etc/rsyslog.d/50-default.conf 
```

and locate the line starting with `#cron.*` and remove the `#` at the start of the line.

![rsyslog](https://linuxhandbook.com/content/images/2022/09/rsyslog-default.png)

To make the changes work, save and close this file and finally restart the rsyslog service and check its status:

```
sudo systemctl restart rsyslog
```

```
sudo systemctl status rsyslog
```

The status of the service should be highlighted as active (running). 

![checking status of rsyslog](https://linuxhandbook.com/content/images/2022/09/rsyslog-status.png)

Now, whenever you need to access the crontab logs, just [read the content of this log file](https://linuxhandbook.com/view-file-linux/):

```
less /var/log/cron.log
```

[PikaPods - Instant Open Source App HostingRun the finest Open Source web apps from $1/month, fully managed, no tracking, no ads, full privacy. Self-hosting was never this convenient.![](https://www.pikapods.com/static/favicon.png)Instant Open Source App Hosting![](https://www.pikapods.com/static/og_image.png)](https://www.pikapods.com/?ref=linuxhandbook.com)

## Method 3: Use dedicated services like Cronitor monitor cron jobs

[Cronitor](https://cronitor.io/cron-job-monitoring?ref=linuxhandbook.com) is a service that can be deployed to monitor any type of cron job.

Many of the cron versions will start logging when the scheduled job executes or if there are any problems with the crontab. However, the output from the cron job or its exit status is not logged. 

Here Cronitor comes in handy and works perfectly. It is a complete solution for all your crontab needs. It captures logs, metrics, and status from all the jobs and creates instant alerts for crashed or failed to [start cron jobs](https://linuxhandbook.com/start-stop-restart-cron/).

You can see all this through a web-based interface.

For Cronitor or CronitorCLI installed on Kubernetes, logs can be captured for as high as 100MB for a single execution. [Here](https://cronitor.io/docs/using-cronitor-cli%23installation?ref=linuxhandbook.com), you can find the detailed installation steps on Linux for CronitorCLI.

Other [monitoring tools and services](https://linuxhandbook.com/server-monitoring-tools/) like Better Uptime also provide the feature to monitor the cron jobs automatically.

[Uptime (formerly Better Uptime) | Better StackMonitor everything from websites to servers. Schedule on-call rotations, get actionable alerts, and resolve incidents faster than ever.![](https://uptime.betterstack.com/assets/favicon-ad4a170f31b6075c4d7ea5e23ce36677b3412bdd2fabc48d1b688bc535c8821c.png)@BetterUptime.![](https://betterstack.com/assets/v2/og_uptime-4c9726279966ac6fc9913d6f4ec793762bc76460d5ed64c4bed93c408e3505e1.jpg)](https://uptime.betterstack.com/?ref=7eqa)

## Conclusion

System log files are very crucial for troubleshooting and diagnosing system-related issues, cron logs are thus no exception for this. 

The Syslog keeps the logs related to crontab however, having a dedicated log file for cron is recommended. A web-based service like Cronitor, Better Uptime, and Uptime Robot also helps.

By the way, did you [know about the at command that can also be used for scheduling tasks](https://linuxhandbook.com/at-command/)?

[Schedule Jobs in Linux With ‘at’ CommandThe at command in Linux can be used to schedule jobs that do not run on a regular schedule. Learn how to use the at command.![](https://linuxhandbook.com/content/images/size/w256h256/2021/08/Linux-Handbook-New-Logo.png)Linux HandbookChristopher Murray![](https://linuxhandbook.com/content/images/2020/06/at_command-1.jpg)](https://linuxhandbook.com/at-command/)