summaryrefslogtreecommitdiff
path: root/.bashrc
diff options
context:
space:
mode:
Diffstat (limited to '.bashrc')
-rw-r--r--.bashrc5
1 files changed, 5 insertions, 0 deletions
diff --git a/.bashrc b/.bashrc
index c4439e7..f23a6f2 100644
--- a/.bashrc
+++ b/.bashrc
@@ -1,6 +1,11 @@
# .bashrc
echo .bashrc begin
+# Make a history backup since history is lost sometimes
+BACKUPS=~/Backups/$(date +%Y)/bash_hist/
+[[ ! -d $BACKUPS ]] && mkdir -p $BACKUPS
+cp ~/.bash_history $BACKUPS/$(date +%s)
+
# Load ENV file (shared with POSIX shell)
[ $0 != sh ] && [ -n "${ENV:=$HOME/.env}" ] && . "$ENV"