zsh-users
 help / color / mirror / code / Atom feed
* SSD-friendly history
@ 2022-10-05 21:34 Dominik Vogt
  2022-10-05 22:50 ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Dominik Vogt @ 2022-10-05 21:34 UTC (permalink / raw)
  To: Zsh Users

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-10-06  6:11 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-05 21:34 SSD-friendly history Dominik Vogt
2022-10-05 22:50 ` Bart Schaefer
2022-10-05 23:19   ` Dominik Vogt
2022-10-06  6:10     ` Bart Schaefer

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).