Thinking the file is overwritten (confusing 'w' and 'a')
Assuming cron can't run Python scripts
Expecting an error without checking code
4.
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?
medium
A. The cron syntax is wrong and will cause an error
B. The time format in cron uses 24-hour clock, so 7 AM is invalid
C. Cron jobs cannot run shell scripts
D. The script myscript.sh does not have execute permission
Solution
Step 1: Check cron syntax correctness
The cron line 0 7 * * * is correct for 7 AM daily.
Step 2: Identify common script execution issues
If the script lacks execute permission, cron cannot run it, causing failure.
Final Answer:
The script myscript.sh does not have execute permission -> Option D
Quick Check:
Scripts need execute permission to run = B [OK]
Hint: Check script permissions if cron job doesn't run [OK]
Common Mistakes:
Assuming cron syntax is wrong
Believing cron can't run shell scripts
Misunderstanding 24-hour time format
5.
You want to automate a backup on your Raspberry Pi that runs every Sunday at midnight and saves files only if the backup folder is not empty. Which method best achieves this?
hard
A. Use a systemd timer that runs every hour regardless of folder content
B. Use a cron job with a script that checks if the folder is empty before backing up
C. Manually run the backup script every Sunday
D. Use a cron job that runs the backup script without any checks
Solution
Step 1: Understand the backup timing requirement
The backup should run every Sunday at midnight, so scheduling is needed.
Step 2: Add condition to check folder content
The script should check if the backup folder is not empty before running to avoid unnecessary backups.
Step 3: Choose the best automation method
A cron job with a script that includes the folder check meets both timing and condition requirements.
Final Answer:
Use a cron job with a script that checks if the folder is empty before backing up -> Option B
Quick Check:
Schedule + condition check = D [OK]
Hint: Combine schedule and condition in script for smart automation [OK]
Common Mistakes:
Running backup without checking folder content
Relying on manual runs instead of automation
Using timers that run too often ignoring conditions
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.