System Clock, Timezones & Power (timedatectl & shutdown)
Concept et aperçu
Accurate system time is critical for log auditing, authentication protocols (Kerberos, TLS certificates), and scheduled database backups.
- The timedatectl utility queries and changes the system clock and its timezone.
- View the current time settings, RTC, and active timezone with timedatectl status (or simply timedatectl).
- Set the system timezone using superuser rights: sudo timedatectl set-timezone UTC.
- When shutting down or restarting production servers, use the shutdown command with safety delays and broadcast notices: sudo shutdown -r now (reboots immediately) or sudo shutdown -c (cancels scheduled shutdowns).
timedatectl status. Set the system timezone to UTC using sudo timedatectl set-timezone UTC. Then initiate a safe immediate reboot command with sudo shutdown -r now.Référence de syntaxe des commandes
| Command / Syntax | Description |
|---|---|
timedatectl status | Show current time and timezone settings |
sudo timedatectl set-timezone UTC | Set system timezone to UTC |
sudo shutdown -r now | Reboot system safely immediately |
Objectifs de vérification
- ○Inspect time status with "timedatectl status"
- ○Set timezone to UTC with "sudo timedatectl set-timezone UTC"
- ○Initiate immediate reboot with "sudo shutdown -r now"