nerdexam
Linux_Foundation

LFCS · Question #77

Which of the following crontab entries will execute myscript at 30 minutes past every hour on Sundays?

The correct answer is D. 30 0-23 * * 0 myscript. A crontab entry for 30 minutes past every hour on Sundays requires setting the minute to 30, the hour to all (0-23 or *), and the day of week to 0 (Sunday).

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

Question

Which of the following crontab entries will execute myscript at 30 minutes past every hour on Sundays?

Options

  • A0 * * * 30 myscript
  • B30 * * * 6 myscript
  • C30 0 * * 0 myscript
  • D30 0-23 * * 0 myscript
  • E0 0-23 * * 30 myscript

How the community answered

(33 responses)
  • A
    9% (3)
  • B
    3% (1)
  • C
    12% (4)
  • D
    73% (24)
  • E
    3% (1)

Why each option

A crontab entry for 30 minutes past every hour on Sundays requires setting the minute to 30, the hour to all (0-23 or *), and the day of week to 0 (Sunday).

A0 * * * 30 myscript

The last numeric field `30` represents the day of the week, where 0-7 are Sunday through Saturday, so `30` is an invalid day of the week.

B30 * * * 6 myscript

The last field `6` represents Saturday, not Sunday, making it incorrect for 'Sundays'.

C30 0 * * 0 myscript

The second field `0` specifies only midnight (00:30), not every hour, making it incorrect for 'every hour on Sundays'.

D30 0-23 * * 0 myscriptCorrect

The first field `30` specifies 30 minutes past the hour, `0-23` specifies every hour, `* *` specifies every day of the month and month, and `0` specifies Sunday as the day of the week, thus executing the script at 30 minutes past every hour on Sundays.

E0 0-23 * * 30 myscript

The first field `0` specifies 0 minutes past the hour, not 30 minutes past, and the last field `30` is an invalid day of the week.

Concept tested: Crontab syntax (day of week)

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

Topics

#Crontab#Job Scheduling#Cron Syntax#Automation

Community Discussion

No community discussion yet for this question.

Full LFCS Practice