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.
echo '/usr/local/bin/report' | at 18:30Correct. It feeds the command to at for 18:30.
atq 18:30 /usr/local/bin/reportIncorrect. atq lists existing jobs.
atrm 18:30 /usr/local/bin/reportIncorrect. 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
Cron
A scheduler for recurring jobs described by a time-field table.
at
A scheduler for one-time jobs queued for a specified time.
Anacron
A scheduler that can run periodic jobs after a system was unavailable.