nerdexam
CompTIACompTIA

XK0-005 · Question #125

XK0-005 Question #125: Real Exam Question with Answer & Explanation

The correct answer is B: 15 13 * * 5 df > /freespace. The cron job entry 15 13 5 df > /freespace correctly schedules the df command to run at 1:15 p.m. (13:15 in 24-hour format) every Friday (day of week 5) and redirects its output to /freespace.

System Management

Question

A Linux administrator needs to schedule a cron job to run at 1:15 p.m. every Friday to report the amount of free disk space on the system and to send the output to a file named "freespace". Which of the following would meet this requirement?

Options

  • A13 15 * * 5 df > /freespace
  • B15 13 * * 5 df > /freespace
  • C15 1 * * 6 df > /freespace
  • D15 13 6 * * df > /freespace

Explanation

The cron job entry 15 13 * * 5 df > /freespace correctly schedules the df command to run at 1:15 p.m. (13:15 in 24-hour format) every Friday (day of week 5) and redirects its output to /freespace.

Common mistakes.

  • A. The minute and hour fields are swapped; 13 15 would mean 3:13 p.m. instead of 1:15 p.m.
  • C. 15 1 * * 6 would run at 1:15 a.m. on Saturday, not 1:15 p.m. on Friday.
  • D. 15 13 6 * * would run at 1:15 p.m. on the 6th day of every month, not specifically every Friday.

Concept tested. Cron job scheduling syntax

Reference. https://man7.org/linux/man-pages/man5/crontab.5.html

Topics

#cron jobs#task scheduling#df command#I/O redirection

Community Discussion

No community discussion yet for this question.

Full XK0-005 PracticeBrowse All XK0-005 Questions