You can modify your ~./bash_history file so it doens't store duplicates and stores more lines than the default (only 1000):
However, sometimes you want to go back to your history file and see what commands you issued on a particular day .... one solution is to make a periodic backup with a timestamp using cron.
First, make a directory to put your files in, and make a script which is going to do the work:
Open the shell script and copy the following inside
close, then in the terminal issue
admittedly hourly is a little excessive - go here is you are unfamiliar with cron scheduling definitions and modify as you see fit