Bird
0
0

You want to run a script every 15 minutes between 9 AM and 5 PM on weekdays. Which crontab entry achieves this?

hard📝 Application Q8 of 15
Linux CLI - Cron and Scheduling
You want to run a script every 15 minutes between 9 AM and 5 PM on weekdays. Which crontab entry achieves this?
A*/15 9-17 * * 1-5 /path/to/script.sh
B15 */9-17 * * 1-5 /path/to/script.sh
C0 9-17/15 * * 1-5 /path/to/script.sh
D*/15 9-17 * * 6,7 /path/to/script.sh
Step-by-Step Solution
Solution:
  1. Step 1: Understand timing requirements

    Every 15 minutes means minute field = */15; hours 9 to 17 means 9-17; weekdays are 1-5.
  2. Step 2: Match with options

    */15 9-17 * * 1-5 /path/to/script.sh correctly uses these fields and runs the script.
  3. Final Answer:

    */15 9-17 * * 1-5 /path/to/script.sh -> Option A
  4. Quick Check:

    Minute */15, hour 9-17, day 1-5 = correct [OK]
Quick Trick: Use */15 for every 15 minutes, 1-5 for weekdays [OK]
Common Mistakes:
  • Swapping hour and minute fields
  • Using weekend days instead of weekdays
  • Incorrect step syntax in hour field

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes