xref: /OK3568_Linux_fs/yocto/poky/meta/recipes-core/initscripts/initscripts-1.0/save-rtc.sh (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1#!/bin/sh
2#
3# SPDX-License-Identifier: GPL-2.0-only
4#
5
6### BEGIN INIT INFO
7# Provides:          save-rtc
8# Required-Start:
9# Required-Stop:     $local_fs hwclock
10# Default-Start:     S
11# Default-Stop:      0 6
12# Short-Description: Store system clock into file
13# Description:
14### END INIT INFO
15
16TIMESTAMP_FILE=/etc/timestamp
17
18[ -f /etc/default/timestamp ] && . /etc/default/timestamp
19
20# Update the timestamp
21date -u +%4Y%2m%2d%2H%2M%2S 2>/dev/null > "$TIMESTAMP_FILE"
22