XK0-005 · Question #430
XK0-005 Question #430: Real Exam Question with Answer & Explanation
The correct answer is A: 15 2 * * 5 /bin/backup_job.sh. To schedule a recurring task in Linux using cron, the crontab entry must specify the minute, hour, day of month, month, and day of week for execution, followed by the command.
Question
A Linux administrator needs to schedule a backup job to run every Friday at 2:15 a.m. Which of the following lines should the administrator add to the crontab file?
Options
- A15 2 * * 5 /bin/backup_job.sh
- B2 15 * * 5 /bin/backup_job.sh
- C2 * * 15 5 /bin/backup_job.sh
- D2 * 5 15 * /bin/backup_job.sh
Explanation
To schedule a recurring task in Linux using cron, the crontab entry must specify the minute, hour, day of month, month, and day of week for execution, followed by the command.
Common mistakes.
- B.
2 15 * * 5would execute the job at 2 minutes past 3 p.m. (15:02), not 2:15 a.m., due to the incorrect hour and minute placement. - C.
2 * * 15 5would attempt to run at 2 minutes past every hour, every day, in the 15th month (which is invalid), on Friday. - D.
2 * 5 15 *would attempt to run at 2 minutes past every hour, on the 5th day of the month, in the 15th month (which is invalid), on every day of the week.
Concept tested. Linux cron job scheduling
Reference. https://man7.org/linux/man-pages/man5/crontab.5.html
Topics
Community Discussion
No community discussion yet for this question.