.bash_history in F15/16 randomly truncated/incomplete/damaged

James Wilkinson fedora at aprilcottage.co.uk
Sat Mar 24 16:18:02 UTC 2012


Frantisek Hanzlik wrote:
> And more - at several important machines when I want reboot
> them, I press for logging off and then login on for this only
> "shutdown -r now" command. And by then I at these machines not
> observed problems with bash history. Maybe it is speculation,
> but seem for me as systemd causation.

I have noticed that when I shut a computer down using the command line,
systemd will kill any open bash sessions before they get a chance to
save the history to ~/.bash_history.

If this seriously bothers you, you could investigate the history
command, and possibly put it into the PROMPT_COMMAND environment
variable so the history is written to disk each time the shell shows a
new prompt.

Hope this helps,

James.

-- 
E-mail:     james@ | Blinking text seems awfully archaic and old-fashioned in
aprilcottage.co.uk | these days of flash and javascript atrocities, but we had
                   | to manage to get annoyed at the technology that was
                   | available at the time; you youngsters won't understand.
                   |     -- http://lwn.net/Articles/140450


More information about the users mailing list