- CheckMates
- :
- Products
- :
- Quantum
- :
- SMB Gateways (Spark)
- :
- Bash History Config for SMBs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page
Are you a member of CheckMates?
×- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You have to set it in /pfrm2.0/etc/bashrc then it works - just tried it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You have to set it in /pfrm2.0/etc/bashrc then it works - just tried it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
/var/log will be wiped upon rebooting.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I know that 😉 Just for testing. I do not need this bash history....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes the HISTFILE, please be aware, that everything except /pfrm2.0 is wiped upon reboot.
