From b5b5bc58d7036ceca87df2dec937161fa218d61e Mon Sep 17 00:00:00 2001 From: "Fred T. Hamster" Date: Fri, 31 Jan 2025 08:56:10 -0500 Subject: [PATCH] moved very custom agenda scripts into fred area --- scripts/core/variables.sh | 5 +++++ scripts/customize/fred/fred_common.alias | 3 +++ scripts/customize/fred/fred_variables.sh | 5 ++++- .../scripts}/agenda/info_overload_report.sh | 18 +++++++++++++----- 4 files changed, 25 insertions(+), 6 deletions(-) rename scripts/{ => customize/fred/scripts}/agenda/info_overload_report.sh (92%) diff --git a/scripts/core/variables.sh b/scripts/core/variables.sh index 8a7a5fae..91833292 100644 --- a/scripts/core/variables.sh +++ b/scripts/core/variables.sh @@ -334,6 +334,11 @@ define_yeti_variable DEFAULT_FEISTYMEOW_ORG_DIR=/opt/feistymeow.org ############## + # logged historical file where we append our latest report. +# define_yeti_variable FRED_HAMSTER_OVERLOAD_REPORT_FILE="$CLOUD_BASE/stats/overload_history.txt" + + ############## + # set the SHUNIT_PATH so our shunit tests can find the codebase. define_yeti_variable SHUNIT_PATH="$FEISTY_MEOW_SCRIPTS/testkit/shunit" diff --git a/scripts/customize/fred/fred_common.alias b/scripts/customize/fred/fred_common.alias index fa553452..bc8ce96c 100644 --- a/scripts/customize/fred/fred_common.alias +++ b/scripts/customize/fred/fred_common.alias @@ -43,6 +43,9 @@ done # updates local archive drive called craftsman. #define_yeti_alias update_craftsman='source "$FEISTY_MEOW_SCRIPTS/archival/general_updater.sh"; update_archive_drive "/media/fred/craftsman"' +# simple alias to show the current overload status. +define_yeti_alias overload='less $FRED_HAMSTER_OVERLOAD_REPORT_FILE' + #### #ANCIENTS ZONE... to archive or delete or something... diff --git a/scripts/customize/fred/fred_variables.sh b/scripts/customize/fred/fred_variables.sh index 2b73ab68..c1d7d429 100644 --- a/scripts/customize/fred/fred_variables.sh +++ b/scripts/customize/fred/fred_variables.sh @@ -8,7 +8,10 @@ if [ -z "$USER_CUSTOMIZATIONS_LOADED" ]; then export PATH=/usr/local/fred/bin:$PATH # The nuage directory is a cloud-like repository of our personal data, managed as a git repo. - export CLOUD_BASE=$FEISTY_MEOW_PERSONAL_HOME/nuage + define_yeti_variable CLOUD_BASE="$FEISTY_MEOW_PERSONAL_HOME/nuage" + + # logged historical file where we append our latest report. + define_yeti_variable FRED_HAMSTER_OVERLOAD_REPORT_FILE="$CLOUD_BASE/stats/overload_history.txt" # The gruntose web site is expected to reside below, if it exists at all. export WEBBED_SITES=$HOME/web diff --git a/scripts/agenda/info_overload_report.sh b/scripts/customize/fred/scripts/agenda/info_overload_report.sh similarity index 92% rename from scripts/agenda/info_overload_report.sh rename to scripts/customize/fred/scripts/agenda/info_overload_report.sh index 0d760353..01d3acf3 100644 --- a/scripts/agenda/info_overload_report.sh +++ b/scripts/customize/fred/scripts/agenda/info_overload_report.sh @@ -3,13 +3,21 @@ # these metrics are how bogged down we are in to-do type items. # logged historical file where we append our latest report. -REPORT_FILE="$CLOUD_BASE/stats/overload_history.txt" +#external CLOUD_BASE FRED_HAMSTER_OVERLOAD_REPORT_FILE + +#hmmm:: this would be a nifty function, where you can give it a list of variable names to +# check and it bails if they are not set! call it validate_external or something catchier. + +if [ -z "$CLOUD_BASE" -o -z "$FRED_HAMSTER_OVERLOAD_REPORT_FILE" ]; then + echo "$(basename $0): This script requires the two variables CLOUD_BASE and FRED_HAMSTER_OVERLOAD_REPORT_FILE." + exit 1 +fi + +#hmmm: check path validity?! # hierarchies that we look inside of: POWER_BRAIN_HIERARCHY="power_brain" -#hmmm: check path validity? - # given a path, this will find how many items are under it, ignoring svn and git files, plus # other patterns we happen to notice are not useful. function calculate_count() @@ -192,6 +200,6 @@ full_report+="\n\ [gathered on $(date)]\n\n\ ##############" -echo -e "$full_report" | tee -a "$REPORT_FILE" -echo -e "\n{report stored in $REPORT_FILE}" +echo -e "$full_report" | tee -a "$FRED_HAMSTER_OVERLOAD_REPORT_FILE" +echo -e "\n{report stored in $FRED_HAMSTER_OVERLOAD_REPORT_FILE}" -- 2.34.1