Create a Post
cancel
Showing results for 
Search instead for 
Did you mean: 
Mlinko
Contributor
Jump to solution

Bash History Config for SMBs

Dear all,

would you please help me out with my "issue" :-)? How do I "save" bash history on the small embedded boxes? 

in Gaia you just have to edit /etc/bashrc the parameter export HISTFILESIZE=10000 and done. 

But on the SMBs it's not the same...

I've found an old article but the "bash" history doesn't work:

echo $HISTFILE returns: /dev/null.

Use vi /pfrm2.0/etc/bashrc and change the specific line to export HISTFILE=$HOME/.bash_history

After this change exit the session then login again and now you should get
echo $HISTFILE
//.bash_history

After I login again on to the box the history is empty. 

Thank you!

KR
Rok

0 Kudos
1 Solution

Accepted Solutions
Steffen_Appel
Advisor

You have to set it in /pfrm2.0/etc/bashrc then it works - just tried it.

View solution in original post

(1)
7 Replies
G_W_Albrecht
Legend Legend
Legend

In /pfrm2.0/etc/bashrc we see that $HISTFILE is defined as /dev/null. I tried to use a real logfile and all works as expected now!

CCSP - CCSE / CCTE / CTPS / CCME / CCSM Elite / SMB Specialist
0 Kudos
Steffen_Appel
Advisor

You have to set it in /pfrm2.0/etc/bashrc then it works - just tried it.

(1)
Mlinko
Contributor

Which Parameter should I set in the /pfrm2.0/etc/bashrc ? The same as mentioned in my part?

export HISTFILE=$HOME/.bash_history

I'did set it to .bash_history in the file you mentioned, but after reconecting to the GW per SSH the history is not there.

0 Kudos
G_W_Albrecht
Legend Legend
Legend

I did set mine to /var/log/mybashist, did a touch /var/log/mybashist, and after log out/in or disconnect/reconnect it shows the last commands. Compare cat /var/log/mybashist with output of history.

CCSP - CCSE / CCTE / CTPS / CCME / CCSM Elite / SMB Specialist
(1)
Steffen_Appel
Advisor

/var/log will be wiped upon rebooting.

0 Kudos
G_W_Albrecht
Legend Legend
Legend

I know that 😉 Just for testing. I do not need this bash history....

CCSP - CCSE / CCTE / CTPS / CCME / CCSM Elite / SMB Specialist
0 Kudos
Steffen_Appel
Advisor

Yes the HISTFILE, please be aware, that everything except /pfrm2.0 is wiped upon reboot.

0 Kudos

Leaderboard

Epsum factorial non deposit quid pro quo hic escorol.

Upcoming Events

    CheckMates Events