Raspberry Pi - Data Logging and DatabasesWhich of the following is the correct syntax for a cron job that runs a script every day at 3 AM?A* 3 * * * /home/pi/script.shB3 0 * * * /home/pi/script.shC0 3 * * * /home/pi/script.shD0 0 3 * * /home/pi/script.shCheck Answer
Step-by-Step SolutionSolution:Step 1: Understand cron time fieldsCron format is: minute hour day month weekday. To run at 3 AM, hour=3, minute=0.Step 2: Match correct syntax0 3 * * * /home/pi/script.sh uses "0 3 * * *" which means 3:00 AM daily, correct syntax.Final Answer:0 3 * * * /home/pi/script.sh -> Option CQuick Check:Cron time format = minute hour day month weekday [OK]Quick Trick: Minute first, then hour in cron syntax [OK]Common Mistakes:MISTAKESSwapping hour and minute fieldsUsing * incorrectly for hourMisplacing day and month fields
Master "Data Logging and Databases" in Raspberry Pi9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More Raspberry Pi Quizzes Automation and Scheduling - systemd service for auto-start - Quiz 6medium Data Logging and Databases - SQLite database for sensor data - Quiz 15hard MQTT for IoT - Why MQTT is the IoT standard - Quiz 4medium MQTT for IoT - MQTT with QoS levels - Quiz 15hard MQTT for IoT - Why MQTT is the IoT standard - Quiz 14medium Security and Deployment - Securing Raspberry Pi (SSH keys, firewall) - Quiz 4medium Security and Deployment - Securing Raspberry Pi (SSH keys, firewall) - Quiz 12easy Security and Deployment - Remote monitoring and management - Quiz 9hard Security and Deployment - Securing Raspberry Pi (SSH keys, firewall) - Quiz 3easy Security and Deployment - Headless deployment setup - Quiz 13medium