2020-05-27-raspios-buster-lite-armhf
Could someone with a rpi zero please check if their history is working.
I use user pi history to help document a build.
On rpi zero it is disappearing after reboots.
“sudo reboot”
Thanks
Hi Daryl,
What do you mean by “user pi history”? Are you having files which are disappearing? Anything saved to the SD card (aside from data in the swap space) will be available after rebooting.
Regards,
Oliver
Support | Core Electronics
Hi
Thanks for the reply.
The usual history command and the up arrow is not showing the history of commands.
They are disappearing, not completely but partially and randomly between reboots.
I’ve never seen this on rpi3 or rpi4 but it is happening every time on rpi zero with latest raspbian buster lite and also the previous version.
I’d like to see if someone could replicate or has experienced this on the same hardware and OS.
I’ve always used sudo reboot to restart raspberry pi’s and I have a suspicion maybe the rpi zero is shutting down too fast to save the history or something like that.
Hi Daryl,
Can you try running history -a
to append the history to the appropriate file before shutdown to confirm whether that’s causing any issues. There’s also a couple articles about how the bash terminal stores command data that may be worth taking a look at to better determine what’s causing the issues here that I’ve linked below for you.
Bryce
Core Electronics | Support
Hello Bryce
Thanks for the reply.
I will check those things and post if I can figure out what’s going on.
#HISTCONTROL=ignoreboth
append to the history file, don’t overwrite it
shopt -s histappend
for setting history length see HISTSIZE and HISTFILESIZE in bash(1)
HISTSIZE=10000
HISTFILESIZE=20000
Sorry about the bad formatting.
I have adjusted the file size and history length in sudo nano ~/.bashrc
Also used history -a before the last restart.
It seems OK so far.
I’m sure I’m not the only person to see this so I was just putting it out there.
Hey Daryl,
That’s excellent, it was likely reduced as the Pi Zero is naturally quite underpowered, and reducing the size of that file on the OS was likely to save on some memory. Glad to hear that quick modification has resolved the issue. If there’s anything else that we can do for you please let us know!
Bryce
Core Electronics | Support