How Do I Fix “crontab: command not found”

by admin on August 22, 2014

After I ordered new VPS (CentOS 6.x) on DigitalOcean (SSD Cloud VPS). I found that crontab is not installed on server, When I try to execute “crontab -e” command, I got following error

# crontab -e
-bash: crontab: command not found

Installing crontab

To install crontab command, I found it comes from cronie package. Type the following command

# yum install cronie -y

Start it with command

# service crond start

To make it persistent, so that it starts on boot, use:

# chkconfig crond on

How to Add New Job in Crontab

To add a new cron use crontab -e to edit it in editor and add cron as per your requirments.

# crontab -e

Listing Jobs in Crontab

To list the job scheduler under crontab, we can use -l command line switch with crontab command. For example to list jobs scheduled for current user

# crontab -l

To view jobs scheduled under other user specify username with -a switch like below.

# crontab -u  -l

Leave a Comment

Previous post:

Next post: