# cleanup data from timeSampler,
# removes null entries and sorts by time
-# -e edits before cleanup
+# no argument edits before cleanup
# -E edits after cleanup
-if [ "$1" = "-e" ]; then
- vim $HOME/.timeSampler.$HOSTNAME
+TMPFILE=$(tempfile)
+
+if [ "$1" = "" ]; then
+ orig="$HOME/.timeSampler.$HOSTNAME"
+ sort -u $orig > $TMPFILE
+ cp $TMPFILE $orig
+ vim $orig
shift
fi
-TMPFILE=$(tempfile)
for f in $(ls -1 $HOME/.timeSampler.*); do
grep -v "null$" $f | sort -u > $TMPFILE
cp $TMPFILE $f
#BEEP="beep -f707 -n -f500"
#BEEP="beep -f707 -n -f500 -n -f707"
#BEEP="dcop knotify default notify notify Me notext KDE_Vox_Ahem.ogg nofile 1 0"
-BEEP="aplay /usr/share/sounds/pop.wav"
+BEEP="aplay /home/dan/tmp/pop.wav"
MINUTES=6 #to give 10/hour
#MAXJOBS=$((1*60/$MINUTES))
#MAXJOBS=8
MAXJOBS=$(($MAXJOBS-1))
LOGFILE="$HOME/.timeSampler.$HOSTNAME"
+BACKUPFILE="$HOME/.timeSampler.all"
#put something in the buffer to start
for i in $(seq 0 $MAXJOBS); do
fi
echo "$DATE $ACTIVITY" >> $LOGFILE
+ echo "$HOSTNAME $DATE $ACTIVITY" >> $BACKUPFILE
}