Introduction
Cron jobs are an essential part of any Linux system. They allow you to schedule tasks to be run automatically at a specified time or interval. We have listed numerous cron job examples of cron jobs on this page which will run on certain weekdays.
Why Might You Want to Run a Cron Job on Certain Weekdays?
There are several reasons why you might want to run a cron job on certain weekdays. For example, you may want to update your website or blog every Monday morning or generate a report every Friday afternoon. By scheduling your cron jobs accordingly, you can ensure that they will be executed at the most convenient times for you and your users.
Another reason you might want to schedule cron jobs for specific weekdays is to avoid peak traffic periods. For example, if your website receives a lot of traffic on weekends, you may want to schedule your cron jobs for early weekday mornings or late weekday evenings when traffic is typically lower. This will help ensure that your cron jobs do not slow down your website or cause any disruptions for your users.
Examples
Here are some examples of cron jobs/crontabs which run on various “every specific weekday” schedules:
Cron Jobs Every Specific Weekday
These cron jobs will run on specific days of the week:
- Once per week on Monday: 0 0 * * 1
- Once per week on Tuesday: 0 0 * * 2
- Once per week on Wednesday: 0 0 * * 3
- Once per week on Thursday: 0 0 * * 4
- Once per week on Friday: 0 0 * * 5
- Once per week on Saturday: 0 0 * * 6
- Once per week on Sunday: 0 0 * * 0
Cron Jobs Every Weekday Between Two Weekdays
The following cron jobs will run every day of the week between two specific weekdays:
- Once per day on sunday to monday: 0 0 * * 0-1
- Once per day on sunday to tuesday: 0 0 * * 0-2
- Once per day on sunday to wednesday: 0 0 * * 0-3
- Once per day on sunday to thursday: 0 0 * * 0-4
- Once per day on sunday to friday: 0 0 * * 0-5
- Once per day on sunday to saturday: 0 0 * * 0-6
- Once per day on monday to tuesday: 0 0 * * 1-2
- Once per day on monday to wednesday: 0 0 * * 1-3
- Once per day on monday to thursday: 0 0 * * 1-4
- Once per day on monday to friday: 0 0 * * 1-5
- Once per day on monday to saturday: 0 0 * * 1-6
- Once per day on tuesday to wednesday: 0 0 * * 2-3
- Once per day on tuesday to thursday: 0 0 * * 2-4
- Once per day on tuesday to friday: 0 0 * * 2-5
- Once per day on tuesday to saturday: 0 0 * * 2-6
- Once per day on wednesday to thursday: 0 0 * * 3-4
- Once per day on wednesday to friday: 0 0 * * 3-5
- Once per day on wednesday to saturday: 0 0 * * 3-6
- Once per day on thursday to friday: 0 0 * * 4-5
- Once per day on thursday to saturday: 0 0 * * 4-6
- Once per day on friday to saturday: 0 0 * * 5-6
- Once per day on saturday to sunday: 0 0 * * 6,0
Wrapping Up
The examples above should have helped you to set up a cron job to run on specific weekdays.
Remember to check out our main cron jobs cheat sheet and if you are looking to set up a cron job to run every few minutes, hours, days, or months, then be sure to check out our relevant sections. You can also find miscellaneous cron jobs here.
We hope you found some of the crontab examples we’ve listed above helpful. Feel free to let us know if there are any additional examples you’d like to see on this page.