I know that Bash has both
HISTFILESIZE variables that control how long history is saved for, and how much of it is saved. I would like to keep an archive of my history. However, if I set either of the two variables mentioned above to a very large number, it makes searching for old commands very difficult, and after enough time they might get deleted anyway.
How can I automatically archive my bash history files once they get to a certain size, and is this method applicable to other log files (such as