dotfiles

My personal shell configs and stuff
git clone git://git.alex.balgavy.eu/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

commit a9cf952af06729bbeffad03179fbd8c804822d2f
parent 1f1ab6c2090b9dcbd9e7b316511669f4392d7d77
Author: Alex Balgavy <alexander.balgavy@spaceapplications.com>
Date:   Mon, 17 Nov 2025 18:18:42 +0100

backup-zsh-history

Diffstat:
Ascripts/backup-zsh-history | 9+++++++++
1 file changed, 9 insertions(+), 0 deletions(-)

diff --git a/scripts/backup-zsh-history b/scripts/backup-zsh-history @@ -0,0 +1,9 @@ +#!/bin/sh +HIST="$HOME/.config/zsh/.zsh_history" +BACKUPDIR="$HOME/.config/zsh" +TIMESTAMP="$(date "+%F_%T")" + +if [ -s "$HIST" ]; then + zstd < "$HIST" > "$BACKUPDIR/zsh_history_$TIMESTAMP.zstd" +fi +# find . -type f -name 'zsh_history_*.zstd' -exec stat --printf '%Y %n\0' {} \; | sort -znr | sed -zn '3,${s/[^ ]\+ //; p}' | xargs -0 rm