Bird
0
0

This cron job line is intended to run a script every day at 7 AM:

medium📝 Debug Q14 of 15
Raspberry Pi - Automation and Scheduling

This cron job line is intended to run a script every day at 7 AM:

0 7 * * * /home/pi/myscript.sh

But the script does not run. What is the most likely reason?

AThe cron syntax is wrong and will cause an error
BThe time format in cron uses 24-hour clock, so 7 AM is invalid
CCron jobs cannot run shell scripts
DThe script <code>myscript.sh</code> does not have execute permission
Step-by-Step Solution
Solution:
  1. Step 1: Check cron syntax correctness

    The cron line 0 7 * * * is correct for 7 AM daily.
  2. Step 2: Identify common script execution issues

    If the script lacks execute permission, cron cannot run it, causing failure.
  3. Final Answer:

    The script myscript.sh does not have execute permission -> Option D
  4. Quick Check:

    Scripts need execute permission to run = B [OK]
Quick Trick: Check script permissions if cron job doesn't run [OK]
Common Mistakes:
MISTAKES
  • Assuming cron syntax is wrong
  • Believing cron can't run shell scripts
  • Misunderstanding 24-hour time format

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Raspberry Pi Quizzes