Run report at 09:00 Monday through Friday.
Which user crontab line is appropriate?
The fifth field is day of week; 1-5 commonly means Monday through Friday.
Detailed explanation
9 0 * * 1-5 reportIncorrect. It specifies minute 9 and hour 0, which is 00:09.
Incorrect. It specifies minute 9 and hour 0, which is 00:09.
0 9 1-5 * * reportIncorrect. It selects days 1 through 5 of the month.
Incorrect. It selects days 1 through 5 of the month.
0 9 * 1-5 * reportIncorrect. It selects months 1 through 5.
Incorrect. It selects months 1 through 5.
0 9 * * 1-5 reportCorrect. Minute 0, hour 9, and weekday 1-5 match the requirement.
Correct. Minute 0, hour 9, and weekday 1-5 match the requirement.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s\n' '0 9 * * 1-5 report' | awk '{print "minute="$1, "hour="$2, "weekday="$5}'Expected result
minute=0 hour=9 weekday=1-5Key points
- Fifth field is weekday
- 1-5 means weekdays
- 0 9 means 09:00
Notes
- Environment: awk / 合成crontab行
- Command output formatting can vary slightly by distribution or tool version.
- Run the example in a temporary directory or process when possible.
Foundation review
Read the scope first
Check whether the command acts on the current shell, a new process, an existing process, or a file.
Verify the observable result
Use the supplied command and compare the output with the expected result.