From 14eec17441aefb1be8c8d44ce1b9e0bd8cdc8338 Mon Sep 17 00:00:00 2001 From: Frederik Delaere Date: Thu, 14 Sep 2017 13:12:12 +0200 Subject: [PATCH] cleanup old tmp files from crashed rsmodule session --- setup_rsmodules.csh | 3 +++ setup_rsmodules.sh | 3 +++ 2 files changed, 6 insertions(+) diff --git a/setup_rsmodules.csh b/setup_rsmodules.csh index 55deee8..2d27fa3 100644 --- a/setup_rsmodules.csh +++ b/setup_rsmodules.csh @@ -20,6 +20,9 @@ if ( -f ~/.rsmodules_autoload ) then source ~/.rsmodules_autoload endif +# cleanup old tmp files from crashed rsmodules sessions +find ~/.rsmodulestmp* -mtime +1 -exec rm -f {} \; >& /dev/null + # this should be a function, so everytime it is called the info is updated set mod_av="`$RSMODULES_INSTALL_DIR/rsmodules noshell avail`" diff --git a/setup_rsmodules.sh b/setup_rsmodules.sh index 528289e..35a5557 100644 --- a/setup_rsmodules.sh +++ b/setup_rsmodules.sh @@ -23,6 +23,9 @@ if [ -f ~/.rsmodules_autoload ]; then source ~/.rsmodules_autoload fi +# cleanup old tmp files from crashed rsmodules sessions +find ~/.rsmodulestmp* -mtime +1 -exec rm -f {} \; 2> /dev/null + if [ ${BASH_VERSINFO:-0} -ge 3 ]; then # # Bash commandline completion (bash 3.0 and above)