開始時間を取得

開始時間を取得

私はラズベリーパイを持っています。私はcrontabを実行しており、毎日正午に再起動するように指示します(sudo reboot now)。

結果は次のとおりですlast reboot -F

myuser@mypiname:~ $ last -F reboot
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970   still running
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970   still running
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970   still running
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Tue Oct 27 12:00:33 2020 (18562+11:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Tue Oct 27 12:00:03 2020 (18562+11:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Mon Oct 26 12:01:00 2020 (18561+11:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Mon Oct 26 12:00:31 2020 (18561+11:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Mon Oct 26 12:00:03 2020 (18561+11:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Mon Oct 26 12:00:03 2020 (18561+11:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Mon Oct 26 12:00:03 2020 (18561+11:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Sun Oct 25 12:00:33 2020 (18560+11:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Sun Oct 25 12:00:03 2020 (18560+11:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Sat Oct 24 12:00:33 2020 (18559+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Sat Oct 24 12:00:04 2020 (18559+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Fri Oct 23 12:00:03 2020 (18558+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Thu Oct 22 12:00:44 2020 (18557+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Thu Oct 22 12:00:11 2020 (18557+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Wed Oct 21 12:00:06 2020 (18556+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Tue Oct 20 12:00:33 2020 (18555+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Tue Oct 20 12:00:04 2020 (18555+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Mon Oct 19 12:00:33 2020 (18554+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Mon Oct 19 12:00:03 2020 (18554+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Sun Oct 18 12:00:04 2020 (18553+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Sat Oct 17 12:00:04 2020 (18552+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Fri Oct 16 12:00:33 2020 (18551+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Fri Oct 16 12:00:03 2020 (18551+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Fri Oct 16 12:00:03 2020 (18551+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Thu Oct 15 12:00:34 2020 (18550+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Thu Oct 15 12:00:04 2020 (18550+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Wed Oct 14 12:00:04 2020 (18549+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Wed Oct 14 12:00:04 2020 (18549+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Wed Oct 14 12:00:04 2020 (18549+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Tue Oct 13 12:00:33 2020 (18548+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Tue Oct 13 12:00:03 2020 (18548+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Mon Oct 12 12:00:36 2020 (18547+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Mon Oct 12 12:00:04 2020 (18547+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Sun Oct 11 12:00:34 2020 (18546+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Sun Oct 11 12:00:04 2020 (18546+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Sat Oct 10 12:00:33 2020 (18545+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Sat Oct 10 12:00:04 2020 (18545+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Fri Oct  9 12:02:03 2020 (18544+10:02)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Fri Oct  9 12:00:04 2020 (18544+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Thu Oct  8 12:00:34 2020 (18543+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Thu Oct  8 12:00:04 2020 (18543+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Wed Oct  7 12:00:33 2020 (18542+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Wed Oct  7 12:00:04 2020 (18542+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Tue Oct  6 12:00:04 2020 (18541+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Mon Oct  5 17:38:18 2020 (18540+15:38)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Mon Oct  5 12:00:04 2020 (18540+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Sun Oct  4 12:00:33 2020 (18539+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Sun Oct  4 12:00:03 2020 (18539+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Sat Oct  3 12:00:04 2020 (18538+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Fri Oct  2 12:00:03 2020 (18537+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Fri Oct  2 12:00:03 2020 (18537+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Thu Oct  1 18:07:11 2020 (18536+16:07)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Thu Oct  1 18:07:11 2020 (18536+16:07)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Thu Oct  1 18:07:11 2020 (18536+16:07)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Thu Oct  1 18:07:11 2020 (18536+16:07)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Thu Oct  1 18:07:11 2020 (18536+16:07)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Thu Oct  1 12:01:00 2020 (18536+10:00)
reboot   system boot  4.19.66-v7+      Thu Jan  1 01:00:01 1970 - Thu Oct  1 12:00:31 2020 (18536+10:00)

wtmp begins Thu Oct  1 10:28:43 2020

今日(2020年10月27日13:55:XX)午後2時頃にラズベリーパイのプラグを抜いたが、ここにはプラグが抜かれたものと表示されません(おそらく再起動しなかったからだろう)。

最後の再起動時間の代わりに最後の起動時間をどのように知ることができますか?また、最後のブート時間だけでなく、「すべての」ブート時間も持ちたいです。

試してみましたが、last boot -F何も表示されません。

ベストアンサー1

開始時間を取得

Piに直面する最初の問題。起動ログは、デバイスがネットワークタイムサーバーから時間を取得する前に生成されます。デバイスにはバッテリー対応の時計がないため、最初から故障しました1970-01-01T00:00(やはり故障しましたwho -b)。

あなたと私の記録の2番目の日付は合理的に見えますが、実際には締め切りです。

このデバイスの起動時間を記録する方法を見つける必要があります。

いくつかの考え

uptime --since正確な開始時間を教えてください。 (今、システムの時間が正確になりました)。

開始または再起動

次に、再起動と起動が何を意味するのかを尋ねる必要があります。案内のみします。ただし、終了プロセスがあるかどうかを確認できます。我々は時差を見ることができます。どのタイプの終了か(文書化されているかわかりません)確認できますか?再起動タイプの終了ですか?

おすすめ記事