zsh-users
 help / color / mirror / code / Atom feed
From: Dominik Vogt <dominik.vogt@gmx.de>
To: Zsh Users <zsh-users@zsh.org>
Subject: SSD-friendly history
Date: Wed, 5 Oct 2022 22:34:17 +0100	[thread overview]
Message-ID: <Yz34Wf67KJolrztr@localhost> (raw)

The zsh history file is probably the one file that causes the most
wear of the SSD drive:

  setopt APPEND_HISTORY
  setopt HIST_IGNORE_DUPS
  setopt HIST_EXPIRE_DUPS_FIRST
  HISTSIZE=100500
  SAVEHIST=100000

I.e. every time a zsh writes the history file when it exits, it
writes a new copy of the history file with some lines removed from
the top and some added at the end.  (The history file is about 4
MB big resulting in about 100 MB to 1 GB writes every day.)

I'd really like to have a mechanism that appends to the history
until some maximum size is reached and then truncates it to some
much smaller size, e.g.

  HISTSIZE_MAX=200000
  HISTSIZE_TRUNCATE_TO=100000

So the history would only be rewritten every couple of months.
(This probably conflicts with the DUPS options.)

Ciao

Dominik ^_^  ^_^

--

Dominik Vogt


             reply	other threads:[~2022-10-05 21:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-05 21:34 Dominik Vogt [this message]
2022-10-05 22:50 ` Bart Schaefer
2022-10-05 23:19   ` Dominik Vogt
2022-10-06  6:10     ` Bart Schaefer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Yz34Wf67KJolrztr@localhost \
    --to=dominik.vogt@gmx.de \
    --cc=zsh-users@zsh.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).