timedatectl-restorer

2021-11-18 23:27 UTC
  • Xyne

Metadata

Description: Restore system time across reboots when the internal clock is dead.
Latest Version: 2013.7.12
Source Code: src/
Architecture:
  • any
Dependencies:
  • python3
Optional Dependencies:
  • systemd: service support
Arch Repositories:
  • [xyne-any]
  • [xyne-i686]
  • [xyne-x86_64]
AUR Page: timedatectl-restorer
Arch Forum Thread: 166578
Tags:

README

Introduction

This was written in response to this thread on the Arch Linux forum.

It can be used with a systemd service to restore the system clock at startup before NTP synchronized the clock.

Usage

The service is parameterized to accept a number of seconds by which to shift the shutdown time into the future. It should be at least as long as the time to shutdown and reboot the system. The ideal would be to time it to the next reboot but be conservative in estimating this. It is better to have a lagging clock than a leading clock before the time is restored to avoid consistency errors.

Once you have determined the appropriate time (e.g. 10 seconds, to be completely conservative), enable the service:

systemctl enable "timedatectl-restorer@10.service"
systemctl start "timedatectl-restorer@10.service"

The service will create a file in /run to prevent multiple restorations of the system clock in a single session if the service is restarted. Remove this file if you need to restore the clock multiple times for some reason.

Contact
echo xyne.archlinux.org | sed 's/\./@/'
Validation
XHTML 1.0 Strict CSS level 3 Atom 1.0