Challenge - 5 Problems
Crontab Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate1:30remaining
What is the output of this crontab entry?
Given the crontab line below, what time(s) will the command run?
30 2 * * 1 /usr/bin/backup.shLinux CLI
30 2 * * 1 /usr/bin/backup.sh
Attempts:
2 left
💡 Hint
Remember the order: minute, hour, day of month, month, day of week.
✗ Incorrect
The first field is minutes (30), second is hour (2), and the last field '1' means Monday. So it runs at 2:30 AM every Monday.
💻 Command Output
intermediate1:30remaining
What does this crontab entry do?
What is the effect of this crontab line?
0 */4 * * * /usr/bin/cleanup.shLinux CLI
0 */4 * * * /usr/bin/cleanup.sh
Attempts:
2 left
💡 Hint
The hour field uses '*/4' which means every 4 hours.
✗ Incorrect
The minute is 0, hour is every 4 hours (0,4,8,12,16,20), so it runs at the start of those hours daily.
📝 Syntax
advanced2:00remaining
Which crontab entry runs a command every weekday at 6:15 PM?
Select the correct crontab line to run a script at 6:15 PM Monday through Friday.
Attempts:
2 left
💡 Hint
Remember the order: minute, hour, day of month, month, day of week.
✗ Incorrect
Minute is 15, hour is 18 (6 PM), and days 1-5 are Monday to Friday.
🔧 Debug
advanced2:00remaining
Why does this crontab entry not run at midnight as expected?
A user wants to run a script at midnight every day but wrote:
What is the problem?
0 24 * * * /usr/bin/midnight.shWhat is the problem?
Attempts:
2 left
💡 Hint
Check the valid ranges for hour in crontab.
✗ Incorrect
Hours must be between 0 and 23. '24' is invalid and causes the job not to run.
🚀 Application
expert3:00remaining
How many times will this crontab entry run in a week?
Given this crontab line:
How many times does the command run in one week?
*/15 9-17 * * 1-5 /usr/bin/task.shHow many times does the command run in one week?
Attempts:
2 left
💡 Hint
Calculate runs per hour, hours per day, and days per week.
✗ Incorrect
Runs every 15 minutes (4 times per hour) from 9 to 17 hours (9 hours) Monday to Friday (5 days). 4 * 9 * 5 = 180. But 9-17 means hours 9 through 17 inclusive, which is 9 hours (9,10,11,12,13,14,15,16,17). So 4 runs/hour * 9 hours/day * 5 days = 180 runs. The correct answer is 180.