cleanup-timesamples: only purge null / sort this host's entries
authorDan White <dan@whiteaudio.com>
Thu, 11 Jun 2015 17:09:26 +0000 (12:09 -0500)
committerDan White <dan@whiteaudio.com>
Thu, 11 Jun 2015 17:09:26 +0000 (12:09 -0500)
cleanup-timesamples

index cf85c960525d154bf6a4985c8c891dd73796fd97..364efca986d4893a14a51f34cfb1df381b071bf9 100755 (executable)
@@ -24,11 +24,10 @@ vim $SAMPLES
 
 
 if [ "$1" = "-c" ]; then
-    echo "Cleaning and sorting all timeSamples."
-    for f in $(ls -1 $HOME/.timeSampler.*); do
-        grep -v "null$" $f | sort -u > $f.tmp
-        cp $f.tmp $f
-    done
+    echo "Cleaning and sorting timeSamples from this host ($HOSTNAME)."
+
+    grep -v "null$" "$HOME/.timeSampler.$HOSTNAME" | sort -u > $f.tmp
+    cp $f.tmp $f
 fi