0
0
Raspberry Piprogramming~5 mins

Scheduled data collection with cron in Raspberry Pi - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is cron used for on a Raspberry Pi?
Cron is a tool that runs commands or scripts automatically at scheduled times or intervals on a Raspberry Pi.
Click to reveal answer
beginner
How do you edit the cron jobs for the current user?
You use the command crontab -e to open and edit the list of scheduled tasks for the current user.
Click to reveal answer
intermediate
What does the cron time format */5 * * * * mean?
It means the task runs every 5 minutes, every hour, every day, every month, and every weekday.
Click to reveal answer
intermediate
Why is it important to use full paths in cron jobs?
Because cron runs with a limited environment, using full paths ensures the commands and scripts run correctly without missing files or programs.
Click to reveal answer
intermediate
How can you check if your cron job ran successfully?
You can check the cron logs using grep CRON /var/log/syslog or redirect output to a file in your cron job.
Click to reveal answer
Which command opens the cron editor for the current user?
Acrontab -e
Bcronedit
Ccron -open
Deditcron
What does the asterisk (*) symbol mean in a cron schedule?
ASkip this field
BNo value
COnly once
DEvery possible value for that time field
If you want a script to run every day at 3 AM, which cron time would you use?
A0 3 * * *
B3 0 * * *
C* 3 * * *
D0 0 3 * *
Why should you use full paths in cron commands?
ATo make the command shorter
BBecause cron has a limited environment and may not find commands without full paths
CTo speed up the cron job
DIt is not necessary to use full paths
Where can you find logs to check if cron jobs ran successfully?
A/home/user/cron.log
B/etc/cron.log
C/var/log/syslog
D/var/log/cronjobs
Explain how to schedule a Python script to run every hour on a Raspberry Pi using cron.
Think about the cron time format and environment paths.
You got /4 concepts.
    Describe how you would troubleshoot if your scheduled data collection script does not run as expected with cron.
    Look for logs and environment issues.
    You got /4 concepts.