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»General Articles»Running cron job every 12 hours (twice a day)

    Running cron job every 12 hours (twice a day)

    RahulBy RahulAugust 2, 20221 Min ReadUpdated:August 2, 2022

    Some of the tasks are required to run twice per day. You can use */12 in hours section to schedule a job to run at 12AM and 12PM daily. Sometimes you need to run crontab at different hours or minutes. In that case, you can define the hours like 09,17 etc.

    Scheduing crontab every 12 hours
    Scheduing crontab every 12 hours

    For example:

    0    */12   *    *    *      script.sh
    

    The above script will run at 12 AM (00:00:00) and 12 PM (12:00:00) every day.

    As you can see that using */12 executes cron exactly at 12AM and 12PM. But, sometimes you may need to run crontab at different times like 10 AM and 10 PM. In that case, you need to set hours like 10,22. See the below example:

    0    10,22   *    *    *      script.sh
    

    You can change hours of your choice like 09,17 to execute cron at 09 AM and 05 PM.

    Hope this tutorial helps you with crontab configuration and schedule jobs twice a day.

    cron crontab jobs scheduler
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow to run a command on bash script exits
    Next Article Scheduling a Python Script with Crontab

    Related Posts

    How to Import GPG Keys on Ubuntu & Debian (without apt-key)

    2 Mins Read

    Running a Cron job every Sunday (Weekly)

    2 Mins Read

    Scheduling a Python Script with Crontab

    2 Mins Read

    (Resolved) Key is stored in legacy trusted.gpg Keyring

    Updated:August 9, 20222 Mins Read

    How to list all collections in MongoDB database

    1 Min Read

    Mongodb – Get the last record from collection

    1 Min Read

    Leave A Reply Cancel Reply

    Recent Posts
    • How to Import GPG Keys on Ubuntu & Debian (without apt-key)
    • How To Install Google Chrome On macOS
    • How to Install Minecraft on Ubuntu 22.04 & 20.04
    • Running a Cron job every Sunday (Weekly)
    • Running Multiple Commands At Once in Linux
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

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