Skip to content

FuLygon/go-histdbimport

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This fork aim to support histfile without timestamp.

go-histdbimport

An tool for importing old zsh history into histdb

Environment Variable

For histfile without timestamp, current timestamp will be used as timestamp for every entry, this will make the order of the commands in database after import different from the histfile, to preserve this order, use env PRESERVE_ORDER. Importing might take longer if preserving order, depend on how large the histfile is

$ export PRESERVE_ORDER=true

By default, this tool will read the default path of both histfile and db ($HOME/.zsh_history and $HOME/.histdb/zsh-history.db), to change this use DB_PATH and HISTORY_PATH.

$ export DB_PATH=/home/user/zsh_history.db
$ export HISTORY_PATH=/home/user/.histfile

If for some reason importing directly into currently using db ($HOME/.histdb/zsh-history.db) success but histdb return error, try import into template.db and replace instead.
Remember to take backup of the current histfile and db

Compile from source

Edit main.go if needed

$ git clone https://github.com/FuLygon/go-histdbimport.git && cd go-histdbimport
$ go build main.go

About

HistDB Import Tool

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Go 100.0%