X-Git-Url: https://feistymeow.org/gitweb/?a=blobdiff_plain;f=scripts%2Fnotes%2Finfo_overload_report.sh;h=7dbd4fe8fbce4bf2d60826787e8e1c499f7b580c;hb=936edc460f256ba5ddba2ad1c80e8d278b9608cc;hp=279a49b664712c43c3707c6050fa99504a4e6953;hpb=d24d2a57be3e90ef033a729c99ab7560c87b9663;p=feisty_meow.git diff --git a/scripts/notes/info_overload_report.sh b/scripts/notes/info_overload_report.sh index 279a49b6..7dbd4fe8 100644 --- a/scripts/notes/info_overload_report.sh +++ b/scripts/notes/info_overload_report.sh @@ -8,7 +8,8 @@ REPORT_FILE="$HOME/cloud/overload_history.txt" function calculate_depth() { local dir="$1"; shift - find "$dir" -type f -exec echo \"{}\" ';' | grep -v "\.svn" | grep -v "\.git"| grep -v "\.basket" | grep -v "\.version" | grep -v "\.keep" | wc -l | tr -d ' ' + depth=$(find "$dir" -type f -exec echo \"{}\" ';' 2>/dev/null | grep -v "\.svn" | grep -v "\.git"| grep -v "\.basket" | grep -v "\.version" | grep -v "\.keep" | wc -l | tr -d ' ') + if [ -z "$depth" ]; then echo 0; else echo "$depth"; fi } # calculates the size in kilobytes of all the note files in a hierarchy. @@ -18,7 +19,8 @@ function calculate_depth() function calculate_weight() { local dir="$1"; shift - find "$dir" -type f -exec echo \"{}\" ';' | grep -v "\.svn" | grep -v "\.git"| grep -v "\.basket" | grep -v "\.version" | grep -v "\.keep" | xargs ls -al | awk '{ print $5 }' | paste -sd+ | bc + weight=$(find "$dir" -type f -exec echo \"{}\" ';' 2>/dev/null | grep -v "\.svn" | grep -v "\.git"| grep -v "\.basket" | grep -v "\.version" | grep -v "\.keep" | xargs ls -al | awk '{ print $5 }' | paste -sd+ | bc 2>/dev/null) + if [ -z "$weight" ]; then echo 0; else echo "$weight"; fi } # produces a report line in our format. @@ -80,6 +82,7 @@ Current information overload consists of:\n\ # notes are individual files of tasks, usually, although some are combined. analyze_hierarchy_and_report ~/cloud/grunty_notes "grunty notes" +#### #hmmm: make an html todo scanning function from this. # scan web documents for to-do lists. individual items are marked with
  • . # we do this one a bit differently since we have different criteria for html to-do items. @@ -88,25 +91,29 @@ total_overload=$(($html_item_depth + $total_overload)) html_item_weight=$(find ~/cloud/grunty_notes/ -type f -iname "*.html" -exec grep "