Recall & Review
beginner
What is a cron job?
A cron job is a scheduled task that runs automatically at set times or intervals on a Raspberry Pi or other Linux systems.
Click to reveal answer
beginner
How do you edit the cron jobs for the current user?
You use the command
crontab -e to open the cron table editor for the current user.Click to reveal answer
intermediate
What does the cron time format look like?
It has five fields: minute (0-59), hour (0-23), day of month (1-31), month (1-12), and day of week (0-7, Sunday=0 or 7). Each field controls when the task runs.
Click to reveal answer
intermediate
How would you schedule a script to run every day at 7:30 AM?
You write this in crontab:
30 7 * * * /path/to/script.sh. This means at minute 30, hour 7, every day, every month, every day of the week.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 system finds the commands and scripts correctly.
Click to reveal answer
Which command opens the cron editor for the current user?
✗ Incorrect
The command
crontab -e opens the cron table editor for the current user.In a cron schedule, what does the '*' symbol mean?
✗ Incorrect
The '*' means the task runs for every possible value in that time field.
How often will this cron job run?
0 0 * * 0 /home/pi/script.sh✗ Incorrect
The '0' in the day of week field means Sunday, so it runs at 00:00 every Sunday.
Why should you use full paths in cron commands?
✗ Incorrect
Cron runs with a minimal environment, so full paths ensure commands are found and run correctly.
What does the following cron time mean?
*/15 * * * *✗ Incorrect
The '*/15' in the minute field means every 15 minutes.
Explain how to create a cron job that runs a backup script every day at 2 AM on a Raspberry Pi.
Think about the time fields and how to edit the cron table.
You got /5 concepts.
Describe why cron jobs might fail if you do not use full paths or environment variables.
Consider what environment cron runs in compared to your normal terminal.
You got /5 concepts.