nerdexam
Linux_Foundation

LFCS · Question #522

The correct crontab entry to execute the script chklog three times per month between 3 p.m. and 5 p.m.:

The correct answer is D. 0 15, 16, 17 1 * * chklog. The crontab entry 0 15,16,17 1 chklog will execute the script chklog at 3 PM, 4 PM, and 5 PM on the first day of every month.

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

Question

The correct crontab entry to execute the script chklog three times per month between 3 p.m. and 5 p.m.:

Options

  • A
    • 3, 4, 5 1 * * chklog
  • B3 3, 4, 5 1 * * chklog
  • C3 15, 16, 17 * * * chklog
  • D0 15, 16, 17 1 * * chklog
  • E
    • 15, 16, 17 1 * * chklog

How the community answered

(27 responses)
  • A
    7% (2)
  • B
    4% (1)
  • D
    78% (21)
  • E
    11% (3)

Why each option

The crontab entry `0 15,16,17 1 * * chklog` will execute the script `chklog` at 3 PM, 4 PM, and 5 PM on the first day of every month.

A* 3, 4, 5 1 * * chklog

The minute field `*` would execute the script every minute, and the hour field `3,4,5` corresponds to 3 AM, 4 AM, and 5 AM, not PM.

B3 3, 4, 5 1 * * chklog

The minute field `3` would execute the script at 3 minutes past the hour, and the hour field `3,4,5` corresponds to 3 AM, 4 AM, and 5 AM, not PM.

C3 15, 16, 17 * * * chklog

The minute field `3` would execute the script at 3 minutes past the hour, and the day-of-month field `*` would execute it every day, not just on a specific day of the month.

D0 15, 16, 17 1 * * chklogCorrect

The minute field `0` ensures execution at the top of the hour, the hour field `15,16,17` specifies 3 PM, 4 PM, and 5 PM respectively, and the day-of-month field `1` ensures these executions occur on the first day of every month. This configuration correctly schedules the script to run three specific times during the specified period on a single day of the month.

E* 15, 16, 17 1 * * chklog

The minute field `*` would execute the script every minute during the specified hours, not once at the top of each hour.

Concept tested: Crontab scheduling syntax

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

Topics

#crontab#job scheduling#system administration#time management

Community Discussion

No community discussion yet for this question.

Full LFCS Practice