Challenge - 5 Problems
Cron Automation Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate2:00remaining
Why is cron used for recurring tasks?
Which of the following best explains why cron is used to automate recurring tasks on Linux systems?
Attempts:
2 left
💡 Hint
Think about what 'recurring' means and how cron handles timing.
✗ Incorrect
Cron is a scheduler that runs commands automatically at specified times repeatedly, so users don't have to run them manually each time.
💻 Command Output
intermediate2:00remaining
Output of a cron job listing
What is the output of the command `crontab -l` if the user has these two cron jobs set?
1. Runs a backup script every day at 2 AM
2. Runs a cleanup script every Sunday at 3 AM
Linux CLI
0 2 * * * /home/user/backup.sh 0 3 * * 0 /home/user/cleanup.sh
Attempts:
2 left
💡 Hint
The `crontab -l` command lists the cron jobs exactly as scheduled.
✗ Incorrect
The output shows the exact cron schedule lines for each job, specifying minute, hour, day, month, and weekday.
📝 Syntax
advanced2:00remaining
Identify the correct cron schedule syntax
Which cron schedule line correctly runs a script every 15 minutes?
Attempts:
2 left
💡 Hint
Look for the syntax that means 'every 15 minutes' in the minutes field.
✗ Incorrect
The '*/15' in the minutes field means every 15 minutes. Other options run at specific times.
🔧 Debug
advanced2:00remaining
Why does this cron job not run?
A user added this cron job to run a script every day at 1 AM:
`0 1 * * * /home/user/myscript.sh`
But the script never runs. What is the most likely reason?
Attempts:
2 left
💡 Hint
Check if the script can be run manually first.
✗ Incorrect
If the script lacks execute permission, cron cannot run it even if the schedule is correct.
🚀 Application
expert2:00remaining
Determine the number of times a cron job runs in a week
A cron job is scheduled as:
`30 6 * * 1-5 /usr/bin/task.sh`
How many times will this job run in one week?
Attempts:
2 left
💡 Hint
Look at the day-of-week field and count the days it covers.
✗ Incorrect
The job runs at 6:30 AM Monday through Friday, which is 5 days a week.