Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Bug: Losing .zsh_history
- X-seq: zsh-users 28180
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: dominik.vogt@xxxxxx, zsh-users@xxxxxxx
- Subject: Re: Bug: Losing .zsh_history
- Date: Wed, 5 Oct 2022 15:31:07 -0700
- Archived-at: <https://zsh.org/users/28180>
- In-reply-to: <Yz318YDhCbJSx4zn@localhost>
- List-id: <zsh-users.zsh.org>
- References: <Yz3hLjGCw/bccjFY@localhost> <c4cb4324-acc5-a972-6b0d-b6561eeb3d80@gmx.com> <Yz3m8ClMWdm1iTKE@localhost> <50fa26c9-98aa-1fc7-6bc5-f552a1f450f3@protonmail.com> <Yz318YDhCbJSx4zn@localhost>
On Wed, Oct 5, 2022 at 2:24 PM Dominik Vogt <dominik.vogt@xxxxxx> wrote:
>
> On Wed, Oct 05, 2022 at 09:05:44PM +0000, Wesley wrote:
> >
> > This might be interesting to read:
> > https://unix.stackexchange.com/a/273869
>
> Interesting.
Somethig like that is the most likely culprit: The filesystem has
allocated space for the buffered content to be written out, but
cutting the power brings the system down before the buffer is flushed
to disk. This is most often seen on "soft-mounted" NFS filesystems
that use delayed writes, but it's certainly possible to happen locally
on abrupt loss of power.
If avoiding FS lossage is important enough to you, you might try
getting a battery power supply unit and configure the power daemon to
do an orderly shutdown if the PS switches to battery. Then instead of
powering off the machine, unplug the PS.
If the problem merely seems to be that a shell you can't see has
started up and is trying to update the history when it shuts down, you
could add something to .zlogin to make a backup copy of the history
when the shell starts. The circumstances you've described are odd,
though, because I wouldn't expect a shell to have any opportunity to
begin processing its shutdown when power is cut. If the same problem
that causes the blank display has already killed the shell, there may
be a connection between the failing display and failing disk
operations.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author