From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Bj=C3=B6rn?= Bidar Newsgroups: gmane.emacs.help Subject: Re: Saving emacs uptime? Date: Fri, 27 Sep 2024 14:06:54 +0300 Message-ID: <15461.897679937$1727435264@news.gmane.org> References: <87v7yi3822.fsf@skimble09.plus.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4097"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Stefan Monnier To: Stefan Monnier via Users list for the GNU Emacs text editor Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 27 13:07:38 2024 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1su8p0-0000y2-EC for geh-help-gnu-emacs@m.gmane-mx.org; Fri, 27 Sep 2024 13:07:38 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1su8oQ-0003T2-0a; Fri, 27 Sep 2024 07:07:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1su8oN-0003Su-Pj for help-gnu-emacs@gnu.org; Fri, 27 Sep 2024 07:07:00 -0400 Original-Received: from thaodan.de ([185.216.177.71]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1su8oL-0007vX-TK for help-gnu-emacs@gnu.org; Fri, 27 Sep 2024 07:06:59 -0400 Original-Received: from odin (dsl-trebng12-50dc75-154.dhcp.inet.fi [80.220.117.154]) by thaodan.de (Postfix) with ESMTPSA id 6D86DD0005B; Fri, 27 Sep 2024 14:06:55 +0300 (EEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=thaodan.de; s=mail; t=1727435215; bh=bVOklw98gE5/EclHi/A56Hw80otvaRAPdvPbsbZLleg=; h=From:To:Cc:Subject:In-Reply-To:References:Date; b=Ymk+q709UkFPnqzxuQTQetcrDgwdp9S+XCVmVGbHkl8lpd/8YE0wp9X2jj0UKBusA UKcrC351tjwDY7FbBqGrl24oIZ0JQXYsH6DzYc1JUcHUZPupjSLiB8WbJru90HWv7O 4mgCEFW5JrkBLB60mziLnUezlcoc1u8y9fSLif5TSUDRphUZhUWc5zwRYOrf12cTr9 RsTFY/cvKEOYzr39/3tvsHMnemfZOXSBVbnIffTRuCY7RrEx+nI1/60K6EXUEg8jgv uujWj41deKH0FCeFzq+rXPPwbf83ceJh4eBTVA+8F8i5XrhoxwZXJcFYk0K0Gfjo9r jh5OMNfXmSg09wj5yDh+kfUqC3GW/LShvZuIEEmKk6oV1tMGTBqcFDwsBXisqJapZw TNWeGGWtcO3QYk1IBqn/f2ga+5q4+DvdseiAJDgnZCQMLin7dm5kLffcj1cqwpoA1Y r7s/znFIZ5u5h9cmYLyyR4B5Fmr0/PkHLVNomhd9FQVYioftXa3EtY3gaWWYSaMGIc HSytCpNvqm+JPKqUi7clgms0HAAr59BCNCJk6HXWVS0N3KupSWHWe8Rx4hiyzK934w JU0a0VOHP4YjpEWaLMC4aek/m7GlyYu2SK8poqdGWMIGksip5DtaXszgrBRlXp1vAK 19Zw20gV9ebito2V/aiFW6Dc= In-Reply-To: (Stefan Monnier via Users list for the's message of "Thu, 26 Sep 2024 10:31:18 -0400") Autocrypt: addr=bjorn.bidar@thaodan.de; prefer-encrypt=nopreference; keydata= mDMEZNfpPhYJKwYBBAHaRw8BAQdACBEmr+0xwIIHZfIDlZmm7sa+lHHSb0g9FZrN6qE6ru60JUJq w7ZybiBCaWRhciA8Ympvcm4uYmlkYXJAdGhhb2Rhbi5kZT6IlgQTFgoAPgIbAwULCQgHAgIiAgYV CgkICwIEFgIDAQIeBwIXgBYhBFHxdut1RzAepymoq1wbdKFlHF9oBQJk1/YmAhkBAAoJEFwbdKFl HF9oB9cBAJoIIGQKXm4cpap+Flxc/EGnYl0123lcEyzuduqvlDT0AQC3OlFKm/OiqJ8IMTrzJRZ8 phFssTkSrrFXnM2jm5PYDoiTBBMWCgA7FiEEUfF263VHMB6nKairXBt0oWUcX2gFAmTX6T4CGwMF CwkIBwICIgIGFQoJCAsCBBYCAwECHgcCF4AACgkQXBt0oWUcX2hbCQEAtru7kvM8hi8zo6z9ux2h K+B5xViKuo7Z8K3IXuK5ugwA+wUfKzomzdBPhfxDsqLcEziGRxoyx0Q3ld9aermBUccHtBxCasO2 cm4gQmlkYXIgPG1lQHRoYW9kYW4uZGU+iJMEExYKADsCGwMFCwkIBwICIgIGFQoJCAsCBBYCAwEC HgcCF4AWIQRR8XbrdUcwHqcpqKtcG3ShZRxfaAUCZNf2FQAKCRBcG3ShZRxfaCzSAP4hZ7cSp0YN XYpcjHdsySh2MuBhhoPeLGXs+2kSiqBiOwD/TP8AgPEg/R+SI9GI9on7fBJJ0mp2IT8kZ2rhDOjg gA6IkwQTFgoAOxYhBFHxdut1RzAepymoq1wbdKFlH Received-SPF: pass client-ip=185.216.177.71; envelope-from=bjorn.bidar@thaodan.de; helo=thaodan.de X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, INVALID_MSGID=0.568, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.help:148079 Archived-At: Stefan Monnier via Users list for the GNU Emacs text editor writes: >> How can I have emacs save its uptime to a plain text file when it closes, by >> my hand or if it crashes please? > > By definition, when it crashes it can't do anything "well-defined", such > as saving its uptime to a known file. > > I can see two workarounds: > > - Save the uptime on a regular basis (e.g. once an hour). > - Save the uptime not from within Emacs but from a program (script?) you > write which launches Emacs and writes the duration of the session into > a file when the Emacs process ends. > > Stefan Another workaround would be to use the init system to track the life time of Emacs. E.g. systemd tracks how long Emacs has run in general and for user services (emacs.service).