Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Linux Tutorials»How to Install Crontab in CentOS/RHEL 7/6/5

    How to Install Crontab in CentOS/RHEL 7/6/5

    RahulBy RahulOctober 1, 20132 Mins Read

    After migration our site TecAdmin.net to new VPS (CentOS 6.5) on digital ocean hosting we found that Crontab is not installed on server, When I try to execute crontab -l command, I found following error.

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

    After checking the package of crontab command in our older system, I found it comes from cronie package. So i think to write it for TecAdmin.net readers. Use below command to install it. this will install required dependencies also

    Install Crontab

    # yum install cronie
    
    Loaded plugins: fastestmirror
    Loading mirror speeds from cached hostfile
     * base: mirror.web-ster.com
     * updates: mirror.stanford.edu
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package cronie.x86_64 0:1.4.4-12.el6 will be installed
    --> Processing Dependency: dailyjobs for package: cronie-1.4.4-12.el6.x86_64
    --> Running transaction check
    ---> Package cronie-anacron.x86_64 0:1.4.4-12.el6 will be installed
    --> Processing Dependency: crontabs for package: cronie-anacron-1.4.4-12.el6.x86_64
    --> Running transaction check
    ---> Package crontabs.noarch 0:1.10-33.el6 will be installed
    --> Finished Dependency Resolution
    
    Dependencies Resolved
    
    ================================================================================
     Package                        Arch      Version           Repository     Size
    ================================================================================
    Installing:
     cronie                         x86_64    1.4.4-12.el6      base           73 k
    Installing for dependencies:
     cronie-anacron                 x86_64    1.4.4-12.el6      base           30 k
     crontabs                       noarch    1.10-33.el6       base           10 k
    
    Transaction Summary
    ==========================================================
    Install       3 Package(s)
    
    Total download size: 114 k
    Installed size: 220 k
    Is this ok [y/N]: y
    Downloading Packages:
    (1/3): cronie-1.4.4-12.el6.x86_64.rpm                         |  73 kB     00:00
    (2/3): cronie-anacron-1.4.4-12.el6.x86_64.rpm                 |  30 kB     00:00
    (3/3): crontabs-1.10-33.el6.noarch.rpm                        |  10 kB     00:00
    --------------------------------------------------------------------------------
    Total                                                336 kB/s | 114 kB     00:00
    Running rpm_check_debug
    Running Transaction Test
    Transaction Test Succeeded
    Running Transaction
      Installing : cronie-1.4.4-12.el6.x86_64                   1/3
      Installing : crontabs-1.10-33.el6.noarch                  2/3
      Installing : cronie-anacron-1.4.4-12.el6.x86_64                           3/3
      Verifying  : crontabs-1.10-33.el6.noarch                                  1/3
      Verifying  : cronie-anacron-1.4.4-12.el6.x86_64                           2/3
      Verifying  : cronie-1.4.4-12.el6.x86_64                                   3/3
    
    Installed:
      cronie.x86_64 0:1.4.4-12.el6
    
    Dependency Installed:
      cronie-anacron.x86_64 0:1.4.4-12.el6            crontabs.noarch 0:1.10-33.el6
    
    Complete!
    

    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. In filesystem crons are saved in file /var/spool/cron/<username&gt;.

    # crontab -e
    

    Read below article to read more about Crontab with 20 useful examples.

    https://tecadmin.net/crontab-in-linux-with-20-examples-of-cron-schedule/

    How to List 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 <username> -l
    
    cron crontab jobs scheduler
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow to Setup vnStat (Network Monitoring tool) on CentOS / RHEL / Fedora
    Next Article How to Setup Red5 Media Server on CentOS/RHEL 7/6/5

    Related Posts

    (Resolved) userauth_pubkey: key type ssh-rsa not in PubkeyAcceptedAlgorithms

    Updated:May 10, 20221 Min Read

    How to Install Apache ActiveMQ on Ubuntu 22.04

    3 Mins Read

    How To Enable SSH Server on Ubuntu 22.04

    Updated:April 22, 20222 Mins Read

    How To Install LAMP Stack on Ubuntu 22.04 LTS

    Updated:April 20, 20225 Mins Read

    10 Best Linux Video Players in 2022

    Updated:February 18, 20226 Mins Read

    How to Switch Python Version in Ubuntu & Debian

    Updated:April 22, 20223 Mins Read

    Leave A Reply Cancel Reply

    Recent Posts
    • How to Enable / disable Firewall in Windows
    • How to Install JAVA on Ubuntu 22.04
    • Switching Display Manager in Ubuntu – GDM, LightDM & SDDM
    • Changing the Login Screen Background in Ubuntu 22.04 & 20.04
    • How To Install PHP (8.1, 7.4 or 5.6) on Ubuntu 22.04
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.