Bird
0
0

You added this line in crontab -e:

medium📝 Debug Q6 of 15
Linux CLI - Cron and Scheduling
You added this line in crontab -e:
30 24 * * * /home/user/script.sh
Why will this cron job not run as expected?
AThe day of week field '*' is invalid; it must be a number 1-7.
BThe minute field '30' is invalid; valid values are 0-29.
CThe command path is incorrect; it must be an absolute path.
DThe hour field '24' is invalid; valid values are 0-23.
Step-by-Step Solution
Solution:
  1. Step 1: Analyze the cron time fields

    The cron format is minute hour day month day_of_week command.
  2. Step 2: Check the hour field

    The hour field is set to 24, but valid hour values range from 0 to 23.
  3. Step 3: Conclusion

    Because '24' is invalid, the cron job will not run.
  4. Final Answer:

    The hour field '24' is invalid; valid values are 0-23. -> Option D
  5. Quick Check:

    Hour must be 0-23, not 24 [OK]
Quick Trick: Cron hour field max is 23, not 24 [OK]
Common Mistakes:
  • Using 24 instead of 0 for midnight hour
  • Confusing minute and hour field ranges
  • Assuming '*' in day of week is invalid

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes