Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 11
Dear All, I have a new centos 5.5 machine. The problem when I type crontab -e it gives me -bash: crontab: command not found. How make my crontab work ? ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2010
    Posts
    72

    crontab -e command not found


    Dear All,
    I have a new centos 5.5 machine. The problem when I type crontab -e it gives me -bash: crontab: command not found. How make my crontab work ? Thank you.

  2. #2
    Administrator MikeTbob's Avatar
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    7,864
    Have you checked to make sure cron is installed?
    I do not respond to private messages asking for Linux help, Please keep it on the forums only.
    All new users please read this.** Forum FAQS. ** Adopt an unanswered post.

    I'd rather be lost at the lake than found at home.

  3. #3
    Just Joined!
    Join Date
    Jul 2010
    Posts
    72
    Dear Mike,
    I have tried this command rpm -qa | grep cron and it show me this
    crontabs-1.10-8. So what is my next step please? Thank you.

  4. #4
    Just Joined!
    Join Date
    Jan 2011
    Location
    chinese
    Posts
    2
    rpm -ql $(rpm -qa|grep cron)
    find the location of crontab command
    then
    export PATH=directory_crontab:$PATH

    crontab command may back

    ensure the crond is running ...

  5. #5
    Just Joined!
    Join Date
    Jul 2010
    Posts
    72
    Dear Linux,
    Ok I have done and the results is below. Then what command must I run. I am not clear which is the directory?


    rpm -ql $(rpm -qa|grep cron)
    /etc/cron.daily
    /etc/cron.hourly
    /etc/cron.monthly
    /etc/cron.weekly
    /etc/crontab
    /usr/bin/run-parts

  6. #6
    Linux Guru Lazydog's Avatar
    Join Date
    Jun 2004
    Location
    The Keystone State
    Posts
    2,677
    Use locate to find things on your CentOs system.

    locate crontab

    You should see it is in /usr/bin/

    This should be in your path already unless you changed it.
    You can check with $PATH

    Regards
    Robert

    Linux
    The adventure of a life time.

    Linux User #296285
    Get Counted

  7. #7
    Just Joined!
    Join Date
    Jan 2011
    Location
    chinese
    Posts
    2

    advise

    Quote Originally Posted by newbie14 View Post
    Dear Linux,
    Ok I have done and the results is below. Then what command must I run. I am not clear which is the directory?
    It seems that you have lost some files of the crontab application.
    give you my file list :
    [root@oracle ~]# rpm -ql $(rpm -qa|grep cron)
    /etc/cron.daily
    /etc/cron.hourly
    /etc/cron.monthly
    /etc/cron.weekly
    /etc/crontab
    /usr/bin/run-parts
    /etc/cron.d
    /etc/pam.d/crond
    /etc/rc.d/init.d/crond
    /etc/sysconfig/crond
    /usr/bin/crontab
    /usr/sbin/crond
    /usr/share/man/man1/crontab.1.gz
    /usr/share/man/man5/crontab.5.gz
    /usr/share/man/man8/cron.8.gz
    /usr/share/man/man8/crond.8.gz
    /var/spool/cron
    /etc/anacrontab
    /etc/cron.daily/0anacron
    /etc/cron.monthly/0anacron
    /etc/cron.weekly/0anacron
    /etc/rc.d/init.d/anacron
    /usr/sbin/anacron
    /usr/share/doc/anacron-2.3
    /usr/share/doc/anacron-2.3/COPYING
    /usr/share/doc/anacron-2.3/README
    /usr/share/man/man5/anacrontab.5.gz
    /usr/share/man/man8/anacron.8.gz
    /var/spool/anacron
    [root@oracle ~]# which crontab
    /usr/bin/crontab

    so i adivice you'd better reinstall it.

    If something wrong .connect with me !

  8. #8
    Just Joined!
    Join Date
    Jul 2010
    Posts
    72
    Dear Linux,
    I think you are right there is a serious problem even locate command is not working as below is the example. So reinstall is the best then.
    [root@localhost /]# locate crontab
    -bash: locate: command not found
    [root@localhost /]# $PATH
    -bash: /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin: No such file or directory
    [root@localhost /]#

  9. #9
    Administrator MikeTbob's Avatar
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    7,864
    You might want to verify your download and the CD/DVD that you burn. I've seen corrupted downloads leave a terrible mess.
    I do not respond to private messages asking for Linux help, Please keep it on the forums only.
    All new users please read this.** Forum FAQS. ** Adopt an unanswered post.

    I'd rather be lost at the lake than found at home.

  10. #10
    Just Joined!
    Join Date
    Jul 2010
    Posts
    72
    Dear Mike,
    Ok will do that thank you for the kind advice by all the rest too. I have not got into a mess but is ok reinstalling will be best here. Thank you.

Page 1 of 2 1 2 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •