0
0
Linux CLIscripting~20 mins

Why cron automates recurring tasks in Linux CLI - Challenge Your Understanding

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Cron Automation Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2: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?
ACron is used to manually start tasks on demand.
BCron executes commands only once when the system boots up.
CCron runs commands at scheduled times repeatedly without manual intervention.
DCron requires user input every time it runs a task.
Attempts:
2 left
💡 Hint
Think about what 'recurring' means and how cron handles timing.
💻 Command Output
intermediate
2: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
A
0 2 * * * /home/user/backup.sh
0 3 * * 0 /home/user/cleanup.sh
B
Runs backup.sh at 3 AM every Sunday
Runs cleanup.sh at 2 AM daily
C
backup.sh runs once at 2 AM
cleanup.sh runs once at 3 AM Sunday
DNo cron jobs scheduled
Attempts:
2 left
💡 Hint
The `crontab -l` command lists the cron jobs exactly as scheduled.
📝 Syntax
advanced
2:00remaining
Identify the correct cron schedule syntax
Which cron schedule line correctly runs a script every 15 minutes?
A* 15 * * * /usr/bin/script.sh
B15 * * * * /usr/bin/script.sh
C0 15 * * * /usr/bin/script.sh
D*/15 * * * * /usr/bin/script.sh
Attempts:
2 left
💡 Hint
Look for the syntax that means 'every 15 minutes' in the minutes field.
🔧 Debug
advanced
2: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?
AThe script does not have execute permission.
BThe cron syntax is invalid.
CCron does not support running scripts at 1 AM.
DThe user must reboot the system for cron jobs to start.
Attempts:
2 left
💡 Hint
Check if the script can be run manually first.
🚀 Application
expert
2: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?
A7 times
B5 times
C1 time
D0 times
Attempts:
2 left
💡 Hint
Look at the day-of-week field and count the days it covers.