TW 20240512 kills bash history
Hi, as a heads-up: after yesterdays TW update my .bash_history is gone (with timestamp of yesterdays update) Anyone else? Cheers Axel
I don't have any updates on Tumbleweed (zypper ref; zypper dup) and am on Tumbleweed 20240512.
My bash history is intact.
Detlev
15 May 2024 10:45:10 Axel Braun
Hi,
as a heads-up: after yesterdays TW update my .bash_history is gone (with timestamp of yesterdays update)
Anyone else? Cheers Axel
Moin, On Wed, 15 May 2024, 10:44:16 +0200, Axel Braun wrote:
Hi,
as a heads-up: after yesterdays TW update my .bash_history is gone (with timestamp of yesterdays update)
Anyone else?
Nope. I'd suggest to look at $HISTFILESIZE and/or $HISTSIZE. Setting HISTCONTROL to "ignoredups:erasedups" helps to slow down the growth rate.
Cheers Axel
Cheers. l8er manfred
Hello,
In the Message;
Subject : TW 20240512 kills bash history
Message-ID : <26399002.1r3eYUQgxm@x1e>
Date & Time: Wed, 15 May 2024 10:44:16 +0200
[AB] == Axel Braun
Am Mittwoch, 15. Mai 2024, 11:37:59 MESZ schrieb Masaru Nomiya:
Hello,
In the Message;
Subject : TW 20240512 kills bash history Message-ID : <26399002.1r3eYUQgxm@x1e> Date & Time: Wed, 15 May 2024 10:44:16 +0200
[AB] == Axel Braun
has written: AB> Hi,
AB> as a heads-up: AB> after yesterdays TW update my .bash_history is gone (with AB> timestamp of yesterdays update)
Please show the results of;
1. $ echo $HISTFILE
docb@X1E:~> english echo $HISTFILE /home/docb/.bash_history (it is there, but empty)
and
2. $ ls -l /home
docb@X1E:~> english ls -l /home total 68 drwxr-xr-x 111 docb users 36864 May 14 19:08 docb drwxrwxrwx 23 test users 4096 Apr 22 14:48 test drwxrwxrwx 3 root root 54 Jul 17 2020 test2 drwxr-xr-x 20 test3 users 4096 Mar 25 20:56 test3 Cheers Axel
Hello,
In the Message;
Subject : Re: TW 20240512 kills bash history
Message-ID : <2683539.lGaqSPkdTl@x1e>
Date & Time: Wed, 15 May 2024 11:49:33 +0200
[AB] == Axel Braun
Am Mittwoch, 15. Mai 2024, 12:46:48 MESZ schrieb Masaru Nomiya:
Ah, how about this?
$ sudo chown docb:docb ~/.bash_history && chmod 660 ~/.bash_history
Not sure that makes sense, as there is no group 'docb' docb@X1E:~> dir .bash_history -rw------- 1 docb users 0 14. Mai 17:21 .bash_history -> Its only writeable for me, and receives updates after bash session is closed. Not sure the latter was always the case.... Cheers Axel
Hello,
In the Message;
Subject : Re: TW 20240512 kills bash history
Message-ID : <4379624.UPlyArG6xL@x1e>
Date & Time: Wed, 15 May 2024 13:29:43 +0200
[AB] == Axel Braun
On 2024-05-15 14:02, Masaru Nomiya wrote:
Your history command store in RAM until you regularly terminate your terminal. Then list of your command write into the .bash_history. If you wanted to write your commands history at anytime you need, use below command:
$ history -a
I have lost history now and then, so possibly a cronjob to make a backup would make sense. -- Cheers / Saludos, Carlos E. R. (from 15.5 x86_64 at Telcontar)
On Wed, 15 May 2024, 14:39:48 +0200, Carlos E. R. wrote:
On 2024-05-15 14:02, Masaru Nomiya wrote:
Your history command store in RAM until you regularly terminate your terminal. Then list of your command write into the .bash_history. If you wanted to write your commands history at anytime you need, use below command:
$ history -a
I have lost history now and then, so possibly a cronjob to make a backup would make sense.
This is true and works as expected - see HISTSIZE and HISTFILESIZE in "man bash". I have set them to 4000000 after having lost my history... @Axel: how much space is free/used in your home directory? Cheers. l8er manfred
On Thu, 16 May 2024, 11:43:08 +0200, Axel Braun wrote:
Am Mittwoch, 15. Mai 2024, 17:28:51 MESZ schrieb Manfred Hollstein:
@Axel: how much space is free/used in your home directory?
some 150 GB left on the device...that should not be the issue ;-)
Again, put the following into your ~/.bashrc and forget about such issues for a long time: HISTCONTROL=ignoredups:erasedups HISTFILESIZE=4000000 HISTSIZE=4000000 The "ignoredups:erasedups" ensures that identical commands are only saved once - you would have to use more than 4000000 different commands, before the file gets truncated again. HTH, cheers. l8er manfred
Hello,
In the Message;
Subject : Re: TW 20240512 kills bash history
Message-ID : <4724158.vXUDI8C0e8@x1e>
Date & Time: Thu, 16 May 2024 11:43:08 +0200
[AB] == Axel Braun
On 2024-05-15 17:28, Manfred Hollstein wrote:
On Wed, 15 May 2024, 14:39:48 +0200, Carlos E. R. wrote:
On 2024-05-15 14:02, Masaru Nomiya wrote:
Your history command store in RAM until you regularly terminate your terminal. Then list of your command write into the .bash_history. If you wanted to write your commands history at anytime you need, use below command:
$ history -a
I have lost history now and then, so possibly a cronjob to make a backup would make sense.
This is true and works as expected - see HISTSIZE and HISTFILESIZE in "man bash". I have set them to 4000000 after having lost my history...
I understand that the history file has a maximum size, but reaching it should just limit the size, not set it to zero. cer@Telcontar:~> echo $HISTFILESIZE 1000 cer@Telcontar:~> cer@Telcontar:~> l .bash_history* -rw------- 1 cer users 33941 May 16 12:38 .bash_history -rw------- 1 cer users 24239 Feb 10 2023 .bash_history.20230211 -rw------- 1 cer users 33941 May 16 12:42 .bash_history.20240516 -rw------- 1 cer users 3372 Jan 4 2011 .bash_history.backup -rw------- 1 cer users 1538 Feb 21 2008 .bash_history.backup2 cer@Telcontar:~>
@Axel: how much space is free/used in your home directory?
cer@Telcontar:~> df -h . Filesystem Size Used Avail Use% Mounted on /dev/sdc5 98G 85G 8,7G 91% /home cer@Telcontar:~> Not a problem. -- Cheers / Saludos, Carlos E. R. (from 15.5 x86_64 at Telcontar)
Hello,
In the Message;
Subject : Re: TW 20240512 kills bash history
Message-ID : <5cc5f81b-3699-48fb-94d7-8539f999cd3a@telefonica.net>
Date & Time: Thu, 16 May 2024 12:43:50 +0200
[CER] == "Carlos E. R."
On 15/5/24 11:44, Axel Braun wrote:
Hi,
as a heads-up: after yesterdays TW update my .bash_history is gone (with timestamp of yesterdays update)
Anyone else?
I've seen this bug a couple of times, very infrequently. This could happen if the shell doesn't exit cleanly (a crash), see BASH's maintainer reply here: https://lists.gnu.org/archive/html/bug-bash/2013-07/msg00096.html I am not sure of the current behaviour in BASH, but I assume the same file writing race condition still exits somehow, very infrequent, but still there. To get around that, I do a regular backup of $HOME, which includes ~/.bash_history (and/or a git repo init'ed in ~/, with .bash_history committed to the repo every now and then). Regards, Ahmad Samir
participants (7)
-
Ahmad Samir
-
Axel Braun
-
Carlos E. R.
-
Detlev Conrad Mielczarek
-
Manfred Hollstein
-
Masaru Nomiya
-
Stratos Zolotas