nerdexam
CompTIA

XK0-005 · Question #277

A junior systems administrator needs to schedule a backup script named /scripts/backup.sh and make the correct changes to the crontab. Which of the following crontab entries would run the script…

The correct answer is C. 5 2 * * 1. The crontab field order is: minute hour day_of_month month day_of_week command. For 2:05 a.m. every Monday: minute=5, hour=2, day_of_month= (any), month= (any), day_of_week=1 (Monday, where 0=Sunday). That gives '5 2 1 /scripts/backup.sh', which matches option C. Option E has…

System Management

Question

A junior systems administrator needs to schedule a backup script named /scripts/backup.sh and make the correct changes to the crontab. Which of the following crontab entries would run the script every Monday at 2:05 a.m.?

Options

  • A1 * * 5 2
  • B2 5 * * 1
  • C5 2 * * 1
  • D1 * * 2 5
  • E5 2 * * 0 /scripts/backup.sh

How the community answered

(58 responses)
  • A
    5% (3)
  • B
    9% (5)
  • C
    83% (48)
  • D
    2% (1)
  • E
    2% (1)

Explanation

The crontab field order is: minute hour day_of_month month day_of_week command. For 2:05 a.m. every Monday: minute=5, hour=2, day_of_month=* (any), month=* (any), day_of_week=1 (Monday, where 0=Sunday). That gives '5 2 * * 1 /scripts/backup.sh', which matches option C. Option E has the correct format but uses 0 for day_of_week (Sunday, not Monday). Options A, B, and D have the fields in the wrong order or wrong values.

Topics

#Crontab#Scheduling#Linux commands#System administration

Community Discussion

No community discussion yet for this question.

Full XK0-005 Practice