1 .TH FAKE-HWCLOCK 8 "1 October 2014" Debian
3 fake-hwclock \- Control fake hardware clock
5 \fBfake-hwclock\fP [ \fIcommand\fP ] [ \fBforce\fP ]
7 Many embedded Linux systems do not have a functional hardware clock. Either
8 they simply don't have a hardware clock at all or they have a hardware clock
9 but it is not usable (e.g. because Linux doesn't know how to use it or because
10 no battery is present).
12 This can lead to time moving backwards to some default value (often 1970) when
13 the system is rebooted. Since lots of software assumes that time only moves
14 forward this is a bad thing. NTP can (and should where practical) be used to
15 sync with an external timeserver but it is not available early in the boot
16 process and may be unavailable for other reasons.
18 The design expectation of \fBfake-hwclock\fP is that it will be run
19 very late at shutdown and very early at boot. This will ensure that
20 fsck has a vaguely sensible idea of system time at boot and won't
21 complain that the last-modified time in the filesystem is not hugely
22 in the past or future. Some users may not worry about this too use
23 case, in which case it is possible to modify the init system
24 configuration to move things earlier/later as appropriate.
27 \fBfake-hwclock\fP sets and queries a fake "hardware clock" which stores the
28 time in a file. This program may be run by the system administrator
29 directly but is typically run by init (to load the time on startup and
30 save it on shutdown) and cron (to save the time hourly).
32 If no command is given then fake-hwclock acts as if the save command was used.
37 Save the time to the file. If force is specified fake-hwclock will move the
38 saved clock either backwards or forwards. Otherwise it will only move
42 Load the time from the file. If force is specified fake-hwclock will move the
43 clock either backwards or forwards. Otherwise it will only move it forwards.
47 \fB/etc/fake-hwclock.data\fR
48 The file used to store the time
50 \fB/etc/init.d/fake-hwclock\fR
51 The init script used to run fake-hwclock on startup and shutdown
53 \fB/lib/systemd/system/fake-hwclock.service\fR
54 systemd service used to run fake-hwclock on startup and shutdown
56 \fB/etc/default/fake-hwclock\fR
57 Settings file for the init script.
59 \fB/etc/cron.hourly/fake-hwclock\fR
60 Cron job used to save the time hourly
61 .SH ENVIRONMENT VARIABLES
65 set the file used by fake-hwclock
67 1 is returned for invalid commands. 0 is returned in all other cases.
69 This approach can only provide a crude approximation of what a real hardware
70 clock provides. Use of NTP or another method to keep the time in sync is