CompTIA Linux+ (XK0-004) — Question 318
A junior systems administrator needs to schedule a backup script named /scripts/backup.sh and make the correct changes to the crontab.
Which of the following crontab entries would run the script every Monday at 2:05 a.m.?
Answer options
- A. 1 * * 5 2 /scripts/backup.sh
- B. 2 5 * * 1 /scripts/backup.sh
- C. 5 2 * * 1 /scripts/backup.sh
- D. 1 * * 2 5 /scripts/backup.sh
- E. 5 2 * * 0 /scripts/backup.sh
Correct answer: C
Explanation
The correct entry is C, as it specifies to run the script at 2:05 a.m. every Monday (1). Option A incorrectly sets the minute to 1 instead of 5. Option B runs the script at 5:02 a.m. instead of 2:05 a.m. Option D has an incorrect day order and minute. Option E specifies Sunday (0), which is not Monday.