A laptop is powered off overnight.
Run daily maintenance after startup when its scheduled time was missed.
Which mechanism is appropriate?
anacron tracks previous runs and can execute overdue day-based jobs after startup on hosts that are not always running.
Detailed explanation
Incorrect. Ordinary cron does not normally catch up jobs missed while powered off.
Incorrect. Ordinary cron does not normally catch up jobs missed while powered off.
Incorrect. atq only lists one-time jobs.
Incorrect. atq only lists one-time jobs.
Correct. anacron is designed for this intermittent-host behavior.
Correct. anacron is designed for this intermittent-host behavior.
Incorrect. atrm removes at jobs.
Incorrect. atrm removes at jobs.
Try it yourself
An example you can run in a temporary verification environment.
anacron --help 2>&1 | sed -n '1,10p'Expected result
anacronの使用方法Key points
- Catch up missed jobs
- Day-based periods
- Run after startup with delay
Notes
- Environment: anacron 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.