QuestionQ106

Linux Fundamentals

A recurring task needs to be automated by scheduling the script at /usr/local/bin/cleanup.sh to execute every Friday at 11:00 PM.

Which of the following crontab entries correctly schedules the job?

  • A 0 11 * * fri /usr/local/bin/cleanup.sh
  • B
    • 23 * * 5 /usr/local/bin/cleanup.sh
  • C 0 23 5 * * /usr/local/bin/cleanup.sh
  • D 0 23 * * 5 /usr/local/bin/cleanup.sh
Explanation

A crontab schedule uses the fields minute, hour, day of month, month, and day of week. 0 23 * * 5 runs at minute 0 of hour 23 on Fridays, with no restriction on the day of month or month.

Community Discussion

No comments yet. Be the first to start the discussion!