From: Don Armstrong Date: Wed, 2 Mar 2011 00:09:23 +0000 (+0000) Subject: * track and delete old xsession error files X-Git-Url: https://git.donarmstrong.com/?p=x_base.git;a=commitdiff_plain;h=2ba286fad7c0af775203e9dd698496cc2176fc49 * track and delete old xsession error files --- diff --git a/.xsession b/.xsession index c7cec50..2930639 100755 --- a/.xsession +++ b/.xsession @@ -2,6 +2,14 @@ echo "Starting new session" +DATE=$(date "+%Y%m%d_%H%M%S") +# track xsession errors +mv ~/.xsession-errors ~/.xsession-errors_${DATE}; +ln ~/.xsession-errors-current ~/.xsession-errors_${DATE}; +# delete old xsession error files +find ~/ -maxdepth 1 -mindepth 1 -type f \ + -iname '.xsession-errors*' -ctime +30 -delete; + if locale -a |grep -qi en_US.utf8; then LANG="en_US.UTF-8" else @@ -34,7 +42,7 @@ fi; # make a backup of the .Xauthority if [ -e ~/.Xauthority ]; then cp -f .Xauthority .Xauthority.bak -fi; +fi if [ -x /usr/bin/xautolock ]; then /usr/bin/xautolock -notifier true -bell 0 &