Facebook X (Twitter) Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook X (Twitter) Instagram
    TecAdmin
    You are at:Home»General Articles»Running cron job every 12 hours (twice a day)

    Running cron job every 12 hours (twice a day)

    By RahulAugust 2, 20221 Min Read

    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

    Related Posts

    Using .env File in FastAPI

    Setting Up Email Notifications for Django Error Reporting

    How to Enable Apache Rewrite (mod_rewrite) Module

    Add A Comment

    Leave A Reply Cancel Reply

    Advertisement
    Recent Posts
    • Using .env Files in Django
    • Using .env File in FastAPI
    • Setting Up Email Notifications for Django Error Reporting
    • How to Enable Apache Rewrite (mod_rewrite) Module
    • What are Microservices?
    Facebook X (Twitter) Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

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