---
title: "How to Run Jobs in Crontab: A Beginners Guide"
description: "Crontab Ubuntu features and their purpose explained. This post has given the best examples for Crontab on how to work with it."
url: https://srinimf.com/2022/07/30/crontab-in-ubuntu-the-top-features/
date: 2022-07-30
modified: 2026-10-10
author: "Srini"
image: https://i0.wp.com/srinimf.com/wp-content/uploads/2022/07/pexels-photo-445012.jpeg?fit=1880%2C1058&ssl=1
categories: ["Linux", "Ubuntu"]
tags: ["Crontab commands", "edit"]
type: post
lang: en
---

# How to Run Jobs in Crontab: A Beginners Guide

Here is a summarized explanation of the commands you need to work with crontab in Ubuntu:

- `crontab -e`: This command allows you to edit your crontab file.
- `crontab -l`: Use this command to list the content of your crontab file.
- `crontab -r`: If you want to remove all entries from your crontab file, you can use this command.

Please note that these commands are specific to Ubuntu and may vary slightly depending on the Linux distribution you are using.

IN THIS PAGE

1. [What is Crontab](https://srinimf.com/2022/07/30/crontab-in-ubuntu-the-top-features/#what-is-crontab)
2. [How to List and Edit crontab](https://srinimf.com/2022/07/30/crontab-in-ubuntu-the-top-features/#how-to-list-and-edit-crontab)
   1. [List command](https://srinimf.com/2022/07/30/crontab-in-ubuntu-the-top-features/#list-command)
   2. [Edit command](https://srinimf.com/2022/07/30/crontab-in-ubuntu-the-top-features/#edit-command)
3. [How to add & run a job in crontab](https://srinimf.com/2022/07/30/crontab-in-ubuntu-the-top-features/#how-to-add-run-a-job-in-crontab)
4. [How to Backup and Replace crontab](https://srinimf.com/2022/07/30/crontab-in-ubuntu-the-top-features/#how-to-backup-and-replace-crontab)
   1. [Backup command](https://srinimf.com/2022/07/30/crontab-in-ubuntu-the-top-features/#backup-command)
   2. [Replace command](https://srinimf.com/2022/07/30/crontab-in-ubuntu-the-top-features/#replace-command)
5. [What is the Timezone in Crontab](https://srinimf.com/2022/07/30/crontab-in-ubuntu-the-top-features/#timezone-in-crontab)

## What is Crontab

Crontab in Ubuntu automates shell scripts. Here is my [earlier post](https://srinimf.com/2017/02/20/how-crontab-the-best-way-in-scheduling-jobs-simplified) on this topic. In Ubuntu or any other Linux operating system, the crontab allows for edits only to root users. The **sudo** users usually are root users.

## **[How to](https://srinimf.com/2018/07/14/unix-top-command-a-video-tutorial/) List and Edit crontab**

Here are four ridiculously useful commands that you can use while working with Crontab. These are list, edit, backup, and replace commands.

### List command

You can view jobs with the list command.

```
$sudo crontab -l # browse
```

### Edit command

You can edit the Crontab with the edit command.

```
$sudo crontab -e #edit
```

## **How to add & run a job in crontab**

To show how to add a cron job, I have added a simple job, which creates a directory at the specified time.

![Crontab in Ubuntu The Top Features](https://i0.wp.com/srinimf.com/wp-content/uploads/2022/07/image-12.png?resize=733%2C539&ssl=1)*Crontab in Ubuntu The Top Features*

The job runs for 15 minutes, at 20 hours, on 30th, July (7th ), and Saturday, The execute command is mkdir srini. A directory of srini is created after running this crontab command.

## **How to Backup and Replace crontab**

### Backup command

Here is a [command](https://tecadmin.net/backup-crontabs-for-users-in-linux/) you can use to take the backup of Crontab.

### Replace command

Taking backup is the best practice before making changes to the Crontab. The following command replaces the current set of jobs with the jobs in the file `crontab.new: `

```
$ crontab -r > crontab.new
```

## **What is the Timezone in Crontab**

Please note that Crontab triggers scripts according to your operating system’s Timezone.

Related

- [How to Edit, Browse, Replace the Crontab](https://srinimf.com/2022/05/06/how-to-edit-browse-replace-the-crontab/)DateMay 6, 2022
- [How to Use Crontab to Schedule Jobs](https://srinimf.com/2017/02/20/how-crontab-the-best-way-in-scheduling-jobs-simplified/)DateFebruary 20, 2017
- [How to Use ‘top’ Command in Linux Correctly](https://srinimf.com/2018/07/14/unix-top-command-a-video-tutorial/)DateJuly 14, 2018

### Share this:

-
- [Tweet](https://twitter.com/share)
- [![](https://i0.wp.com/assets.pinterest.com/images/pidgets/pinit_fg_en_rect_gray_20.png)](https://www.pinterest.com/pin/create/link/?url=https%3A%2F%2Fsrinimf.com%2F2022%2F07%2F30%2Fcrontab-in-ubuntu-the-top-features%2F&media=https%3A%2F%2Fi0.wp.com%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2022%2F07%2Fpexels-photo-445012.jpeg%3Ffit%3D1200%252C675%26ssl%3D1&description=How%20to%20Run%20Jobs%20in%20Crontab%3A%20A%20Beginners%20Guide)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2022/07/30/crontab-in-ubuntu-the-top-features/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2022/07/30/crontab-in-ubuntu-the-top-features/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2022/07/30/crontab-in-ubuntu-the-top-features/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2022/07/30/crontab-in-ubuntu-the-top-features/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%20How%20to%20Run%20Jobs%20in%20Crontab%3A%20A%20Beginners%20Guide&body=https%3A%2F%2Fsrinimf.com%2F2022%2F07%2F30%2Fcrontab-in-ubuntu-the-top-features%2F&share=email)
-

### Like this:

Like Loading…
