Facebook X (Twitter) Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook X (Twitter) Instagram
    TecAdmin
    You are at:Home»General Articles»Running a Cron job every Sunday (Weekly)

    Running a Cron job every Sunday (Weekly)

    By RahulAugust 6, 20222 Mins Read

    Many of the applications required weekly cron jobs to perform a few tasks. For example, perform weekly maintenance, cleanup disk spaces, cleanup mailing list, and other tasks. You may run your weekly tasks on any day of the week. CPU and memory consumption is required for jobs that require a CPU and memory. Those jobs are best to run on a weekend day.

    Scheduling a Cronjob for Sunday.

    The day of the week is determined by the fifth section of the cron timer. You can specify a day by using numbers such as 0-7, where 0 and 7 both correspond to Sunday, 1 is Monday, 2 is Tuesday, and so on. We may also refer to the first three letters of the day like sun, mon, etc.

    The cron daemon can be configured to run shell scripts at 07:30 AM every Sunday using the following line:

    • Define a day in Crontab using numbers:
      30  7  *  *  0      script.sh
      
    • Define a day in Crontab using numbers:
      30  7  *  *  sun      script.sh
      

    You can schedule your weekly cronjob by editing the crontab using “crontab -e” in a text editor.

    Running Crontab Job Every Sunday (Weekly)
    Running crontab job every Sunday (Weekly)

    Scheduing Job with @weekly Keyword

    The @weekly crontab keyword provides for executing tasks every Sunday at 12:00 AM. You may replace the time with @weekly, which saves time. The command will execute at precisely 12:00 AM, and we cannot alter it.

    @weekly     script.sh
    
    Using @weekly in Crontab
    Using @weekly in crontab

    This quick tutorial should help you set up a corn job to run weekly. Please note that you can schedule a job in two-time formats.

    cron cronjobs crontab
    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.