]> git.donarmstrong.com Git - x_base.git/commitdiff
* track and delete old xsession error files
authorDon Armstrong <don@donarmstrong.com>
Wed, 2 Mar 2011 00:09:23 +0000 (00:09 +0000)
committerDon Armstrong <don@donarmstrong.com>
Wed, 2 Mar 2011 00:09:23 +0000 (00:09 +0000)
.xsession

index c7cec500e2fa745717e3d12e372e06c24f0b5948..29306397edf7f893afe588c0935c807ff9c58e1c 100755 (executable)
--- 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 &