<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.alpinelinux.org/w/index.php?action=history&amp;feed=atom&amp;title=Saving_time_with_Software_Clock</id>
	<title>Saving time with Software Clock - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.alpinelinux.org/w/index.php?action=history&amp;feed=atom&amp;title=Saving_time_with_Software_Clock"/>
	<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Saving_time_with_Software_Clock&amp;action=history"/>
	<updated>2026-05-01T16:51:14Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Saving_time_with_Software_Clock&amp;diff=13915&amp;oldid=prev</id>
		<title>John3-16: Categorized:  System Administration</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Saving_time_with_Software_Clock&amp;diff=13915&amp;oldid=prev"/>
		<updated>2017-09-21T02:39:46Z</updated>

		<summary type="html">&lt;p&gt;Categorized:  System Administration&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 02:39, 21 September 2017&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l46&quot;&gt;Line 46:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 46:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;You will also need to include the new init script in your apkprov, otherwise it will be overwritten with the one from the OpenRC package.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;You will also need to include the new init script in your apkprov, otherwise it will be overwritten with the one from the OpenRC package.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{cmd|lbu include /etc/init.d/swclock}}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{{cmd|lbu include /etc/init.d/swclock}}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[Category:System Administration]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>John3-16</name></author>
	</entry>
	<entry>
		<id>https://wiki.alpinelinux.org/w/index.php?title=Saving_time_with_Software_Clock&amp;diff=11141&amp;oldid=prev</id>
		<title>Sillysausage: Created page with &quot; OpenRC has it&#039;s own method for saving the clock called &quot;swclock&quot;, that&#039;s what I went with. Normally swclock simply changes a symlink ie /sbin/openrc-run -&gt; /sbin/openrc when...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.alpinelinux.org/w/index.php?title=Saving_time_with_Software_Clock&amp;diff=11141&amp;oldid=prev"/>
		<updated>2015-08-10T10:40:52Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot; OpenRC has it&amp;#039;s own method for saving the clock called &amp;quot;swclock&amp;quot;, that&amp;#039;s what I went with. Normally swclock simply changes a symlink ie /sbin/openrc-run -&amp;gt; /sbin/openrc when...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
OpenRC has it&amp;#039;s own method for saving the clock called &amp;quot;swclock&amp;quot;, that&amp;#039;s what I went with. Normally swclock simply changes a symlink ie /sbin/openrc-run -&amp;gt; /sbin/openrc when it saves the time.&lt;br /&gt;
&lt;br /&gt;
However this when restored will have the time that the package was put together, because Alpine Linux unpacks packages on boot, then moves the provisioned configs from apkprov. You will need to make these changes to specify a file.&lt;br /&gt;
&lt;br /&gt;
== /etc/init.d/swclock ==&lt;br /&gt;
&amp;lt;pre&amp;gt;--- swclock.old&lt;br /&gt;
+++ swclock&lt;br /&gt;
@@ -3,6 +3,7 @@&lt;br /&gt;
 # Released under the 2-clause BSD license.&lt;br /&gt;
 &lt;br /&gt;
 description=&amp;quot;Sets the local clock to the mtime of a given file.&amp;quot;&lt;br /&gt;
+clock_file=${clock_file:-/etc/rc.conf}&lt;br /&gt;
 &lt;br /&gt;
 depend()&lt;br /&gt;
 {&lt;br /&gt;
@@ -17,7 +18,7 @@&lt;br /&gt;
 {&lt;br /&gt;
 	ebegin &amp;quot;Setting the local clock based on last shutdown time&amp;quot;&lt;br /&gt;
 	if ! swclock 2&amp;gt; /dev/null; then&lt;br /&gt;
-	swclock --warn /sbin/openrc-run&lt;br /&gt;
+	swclock --warn $clock_file&lt;br /&gt;
 	fi&lt;br /&gt;
 	eend $?&lt;br /&gt;
 }&lt;br /&gt;
@@ -25,6 +26,6 @@&lt;br /&gt;
 stop()&lt;br /&gt;
 {&lt;br /&gt;
 	ebegin &amp;quot;Saving the shutdown time&amp;quot;&lt;br /&gt;
-	swclock --save&lt;br /&gt;
+	swclock --save $clock_file&lt;br /&gt;
 	eend $?&lt;br /&gt;
 }&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== /etc/conf.d/swclock ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
clock_file=&amp;quot;/etc/swclock_saved_time&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then touch the file:&lt;br /&gt;
{{cmd|touch /etc/swclock_saved_time}}&lt;br /&gt;
&lt;br /&gt;
and finally add swclock to the boot run level&lt;br /&gt;
{{cmd|rc-update add swclock boot}}&lt;br /&gt;
&lt;br /&gt;
You will also need to include the new init script in your apkprov, otherwise it will be overwritten with the one from the OpenRC package.&lt;br /&gt;
{{cmd|lbu include /etc/init.d/swclock}}&lt;/div&gt;</summary>
		<author><name>Sillysausage</name></author>
	</entry>
</feed>