A daily OnCalendar timer should run once when it is re-enabled if a scheduled occurrence was missed while stopped.
Which [Timer] setting is appropriate?
Persistent=true records the last calendar activation and can catch up a missed occurrence when the timer is enabled again.
Detailed explanation
RemainAfterExit=trueIncorrect. RemainAfterExit concerns service state after exit.
Incorrect. RemainAfterExit concerns service state after exit.
Restart=alwaysIncorrect. Restart controls service restart policy.
Incorrect. Restart controls service restart policy.
AccuracySec=0Incorrect. AccuracySec changes timing precision, not missed-run handling.
Incorrect. AccuracySec changes timing precision, not missed-run handling.
Persistent=trueCorrect. Persistent enables catch-up for missed OnCalendar events.
Correct. Persistent enables catch-up for missed OnCalendar events.
Try it yourself
An example you can run in a temporary verification environment.
printf '%s\n' '[Timer]' 'OnCalendar=daily' 'Persistent=true'Expected result
[Timer]
OnCalendar=daily
Persistent=trueKey points
- Calendar timer
- Persist last activation
- Catch up after re-enable
Notes
- Environment: 合成timer unitの内容確認
- 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.