CompTIA Linux+ Powered by LPI (LX0-104) — Question 28
Which of the following crontab entries will execute myscript at 30 minutes past every hour on Sundays?
Answer options
- A. 0 * * * 30 myscript
- B. 30 * * * 6 myscript
- C. 30 0 * * 0 myscript
- D. 30 0-23 * * 0 myscript
- E. 0 0-23 * * 30 myscript
Correct answer: D
Explanation
The correct answer is D, which specifies that myscript will execute at 30 minutes past every hour on Sunday (0). Option A is incorrect because it specifies minute 0 instead of 30. Option B runs the script at 30 minutes past every hour on Saturday (6), while C restricts execution to midnight on Sunday. Option E incorrectly sets the script to run at hour 0 on the 30th day of the month.