Bird
0
0

A user added this cron job:

medium📝 Debug Q14 of 15
Raspberry Pi - Data Logging and Databases
A user added this cron job:
*/15 * * * * collect_data.sh
But the script does not run. What is the most likely problem?
AThe script path is missing; cron needs full path
BThe cron syntax is invalid
CThe script runs only once a day
DCron does not support scripts with .sh extension
Step-by-Step Solution
Solution:
  1. Step 1: Check cron job command

    The command collect_data.sh lacks a full path. Cron requires full paths to scripts.
  2. Step 2: Understand cron environment

    Cron runs with a minimal environment and does not know where to find scripts without full paths.
  3. Final Answer:

    The script path is missing; cron needs full path -> Option A
  4. Quick Check:

    Always use full script path in cron [OK]
Quick Trick: Always specify full script path in cron jobs [OK]
Common Mistakes:
MISTAKES
  • Assuming cron finds scripts in current directory
  • Thinking .sh extension is unsupported
  • Believing syntax is wrong when it is correct

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Raspberry Pi Quizzes