Register /usr/local/bin/report to run once today at 18:30.
Pass the command through standard input to at.
Which command is appropriate?
at reads the command from standard input and schedules it for one execution at the specified time.
Detailed explanation
at 18:30 /usr/local/bin/reportIncorrect. This is not the usual at input form.
Incorrect. This is not the usual at input form.
echo '/usr/local/bin/report' | at 18:30Correct. It feeds the command to at for 18:30.
Correct. It feeds the command to at for 18:30.
atq 18:30 /usr/local/bin/reportIncorrect. atq lists existing jobs.
Incorrect. atq lists existing jobs.
atrm 18:30 /usr/local/bin/reportIncorrect. atrm removes jobs by ID.
Incorrect. atrm removes jobs by ID.
Try it yourself
An example you can run in a temporary verification environment.
at --help 2>&1 | sed -n '1,8p'Expected result
atの時刻指定を含む使用方法Key points
- Pass the command on stdin
- at runs once
- Specify the time
Notes
- Environment: at help / ジョブ登録なし
- 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.