mediumMultiple ChoiceObjective-mapped
XK0-006 Practice Question: Run a script '/usr/local/bin/cleanup.sh' every…
An administrator needs to run a script '/usr/local/bin/cleanup.sh' every day at 2:30 AM. Which crontab entry is correct?
⚠ Common exam trap
CompTIA often tests the order of minute and hour fields in crontab entries, and the trap here is that candidates may swap them (placing hour first) or use `*/30` thinking it means 'at 30 minutes past the hour' rather than 'every 30 minutes'.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
30 2 * * * /usr/local/bin/cleanup.sh
The correct crontab syntax is `minute hour day month weekday command`. Option D specifies minute 30, hour 2, and asterisks for all other fields, which means the script runs at 2:30 AM every day. This matches the requirement exactly.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
2 30 * * * /usr/local/bin/cleanup.sh
Why it's wrong here
Hour and minute are reversed.
- ✗
*/30 2 * * * /usr/local/bin/cleanup.sh
Why it's wrong here
Runs every 30 minutes between 2:00-2:59 AM.
- ✗
30 * * * * /usr/local/bin/cleanup.sh
Why it's wrong here
Runs at minute 30 of every hour.
- ✓
30 2 * * * /usr/local/bin/cleanup.sh
Why this is correct
Correct syntax for 2:30 AM daily.
Go deeper
Related to this question
About these practice questions
One of 979 original XK0-006 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This XK0-006 practice question is part of Courseiva's free CompTIA certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the XK0-006 exam.