nerdexam
Linux_Foundation

LFCS · Question #765

The correct crontab entry to execute the script chklog once per hour between 3 p.m. and 5 p.m. on Monday and Thursday each week is:

The correct answer is C. 0 15,16,17 * * 1,4 chklog. The crontab entry must specify 0 for minutes, 15, 16, 17 for hours (3, 4, 5 PM in 24-hour format), and 1, 4 for Monday and Thursday respectively.

Submitted by carlos_mx· Apr 18, 2026Operation of Running Systems

Question

The correct crontab entry to execute the script chklog once per hour between 3 p.m. and 5 p.m. on Monday and Thursday each week is:

Options

  • A0 3,4,5 * * 2,5 chklog
  • B0 3,4,5 * * 1,4 chklog
  • C0 15,16,17 * * 1,4 chklog
  • D0 15,16,17 1,4 * * chklog
  • E
    • 15,16,17 * * 1,4 chklog

How the community answered

(27 responses)
  • A
    4% (1)
  • C
    70% (19)
  • D
    19% (5)
  • E
    7% (2)

Why each option

The crontab entry must specify 0 for minutes, 15, 16, 17 for hours (3, 4, 5 PM in 24-hour format), and 1, 4 for Monday and Thursday respectively.

A0 3,4,5 * * 2,5 chklog

`3,4,5` for hours would represent 3 AM, 4 AM, 5 AM, not 3 PM to 5 PM, and `2,5` for day of week would be Tuesday and Friday.

B0 3,4,5 * * 1,4 chklog

`3,4,5` for hours would represent 3 AM, 4 AM, 5 AM, not 3 PM to 5 PM.

C0 15,16,17 * * 1,4 chklogCorrect

The crontab syntax is `minute hour day_of_month month day_of_week command`. `0` specifies the task runs at the top of the hour. `15,16,17` specifies 3 PM, 4 PM, and 5 PM (24-hour format). `*` for day_of_month and month means every day/month, and `1,4` specifies Monday (1) and Thursday (4), typically with Sunday being 0 or 7.

D0 15,16,17 1,4 * * chklog

The day of week (1,4) is incorrectly placed in the day of month field, and the month and day of week fields are swapped, leading to an incorrect schedule.

E* 15,16,17 * * 1,4 chklog

`*` for minutes would run the script every minute during the specified hours, not once per hour.

Concept tested: Crontab syntax and scheduling

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

Topics

#crontab#scheduling#job automation

Community Discussion

No community discussion yet for this question.

Full LFCS Practice