Re:Bashhub – Bash History in the Cloud
by heyrhett on Monday December 07, 2015 @11:56PM
(#10694894)
chattr +a ~/.bash_history
[ Parent
| on HN ]
Re:Bashhub – Bash History in the Cloud
by voltagex_ on Tuesday December 08, 2015 @12:19AM
(#10694961)
What does this do?
Re:Bashhub – Bash History in the Cloud
by dllthomas on Tuesday December 08, 2015 @12:39AM
(#10695005)
`man chattr` says:
"A file with the `a' attribute set can only be open in append mode for writing. Only the superuser or a process possessing the CAP_LINUX_IMMUTABLE capability can set or clear this attribute."
Re:Bashhub – Bash History in the Cloud
by fabulist on Tuesday December 08, 2015 @12:29AM
(#10694981)
After some experimentation, it makes a file impossible to delete.
Very clever, +1.
Re:Bashhub – Bash History in the Cloud
by voltagex_ on Tuesday December 08, 2015 @12:48AM
(#10695033)
I wonder if this solves the issue of multiple bash instances clobbering history.
Re:Bashhub – Bash History in the Cloud
by dllthomas on Tuesday December 08, 2015 @01:04AM
(#10695066)
From the bash manpage:
If the histappend shell option is enabled (see the description of shopt
under SHELL BUILTIN COMMANDS below), the lines are appended to the history
file, otherwise the history file is overwritten.
histappend
If set, the history list is appended to the file named
by the value of the HISTFILE variable when the shell
exits, rather than overwriting the file.
Re:Bashhub – Bash History in the Cloud
by voltagex_ on Tuesday December 08, 2015 @01:59AM
(#10695188)
http://askubuntu.com/a/80380/288724 looks like it might be my issue, specifically
> The bash session that is saved is the one for the terminal that is closed the latest.