Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using the CentOS release 6.3 (Final).

My problem is that even I have logged in as a root to my centos server through ssh crontab command is not available to me .

I got the following when ever I am trying to access the crontab :

[root@cl-t102-433cl bin]# crontab -e
-bash: crontab: command not found

Next time to justify myself I tried :

[root@cl-t102-433cl bin]# locate cron | grep bin

[root@cl-t102-433cl bin]# echo $PATH

Here as per the above two commands everything is seems to fine but why crontab command is not available to me ?

share|improve this question
What is the output of ls -l /usr/bin/crontab? – Hennes Mar 10 '13 at 13:52
It is the out put >> ls: cannot access /usr/bin/crontab: No such file or directory, but I am able to see that file when ever I tried the locate command – usernaveen Mar 10 '13 at 13:54
Is the cronie package installed? yum info cronie. – Daniel Beck Mar 10 '13 at 13:57
Yes it is available(installed). – usernaveen Mar 10 '13 at 14:02
When the command says available, that means it's not installed. – Daniel Beck Mar 10 '13 at 14:10
up vote 3 down vote accepted

ls: cannot access /usr/bin/crontab: No such file or directory

I am able to see that file when ever I tried the locate command

In that case crontab is not installed anymore.

Locate does not search the filesystem. It looks in a database which is usually generated once per day (often around 3AM). If the the contab binary was present when locate last updated itself then it will show up with locate. Even if it got removed afterward.

In your case something deleted the that file, or uninstalled the package responsive for crontab.

share|improve this answer
Do I need to install the cronie again . – usernaveen Mar 10 '13 at 14:04
If you want to use it: yes. Try uninstalling it fully (yum uninstall packagename) and then 'yum install packagename`. (Or whatever package management tool you use. Might be rpm on CentOS. – Hennes Mar 10 '13 at 14:07
Could you please explain me clearly about locate command or else give any link where I can find the stuff. – usernaveen Mar 10 '13 at 14:08
The easiest analogy for locate is the index in a book. That index lists all the subjects and in which chapter or on which page they are discussed. Now if you edit that book then the index also needs to be updated. In your case a chapter from that book got removed, but the index still pointed to it. To update the index run updatedb. If you wish to search without using locate, use find. – Hennes Mar 10 '13 at 14:15
Thank you so much... – usernaveen Mar 10 '13 at 16:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .