nerdexam
Linux_Foundation

LFCS · Question #447

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, which of the following?

The correct answer is C. 0 15,16,17 * * 1,4 chklog. The correct crontab entry for this schedule specifies 0 for minutes, 15,16,17 for hours (3 PM to 5 PM in 24-hour format), for day and month, and 1,4 for Monday and Thursday.

Submitted by priya_blr· 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, which of the following?

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

(23 responses)
  • B
    4% (1)
  • C
    78% (18)
  • D
    13% (3)
  • E
    4% (1)

Why each option

The correct crontab entry for this schedule specifies `0` for minutes, `15,16,17` for hours (3 PM to 5 PM in 24-hour format), `* *` for day and month, and `1,4` for Monday and Thursday.

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

The hours `3,4,5` represent 3 AM, 4 AM, and 5 AM, not PM, and `2,5` represent Tuesday and Friday, not Monday and Thursday.

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

The hours `3,4,5` represent 3 AM, 4 AM, and 5 AM, not PM.

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

The crontab entry `0 15,16,17 * * 1,4 chklog` is correct because `0` specifies the minute (start of the hour), `15,16,17` specifies 3 PM, 4 PM, and 5 PM in 24-hour format, `* *` means every day and month, and `1,4` specifies Monday and Thursday (where Sunday is 0 or 7).

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

Placing `1,4` in the day of month field means the script would run on the 1st and 4th of each month, not specifically on Monday and Thursday of each week.

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

Using `*` in the minute field means the script would run every minute between 3 PM and 5 PM, not once per hour.

Concept tested: Crontab scheduling syntax

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

Topics

#crontab#task scheduling#cron syntax#automation

Community Discussion

No community discussion yet for this question.

Full LFCS Practice