From d0cfb28918420022f659c318f6733a65bed53d5b Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Sat, 13 Nov 2021 14:15:00 -0500 Subject: [PATCH] scripts that find newest and oldest files in hier also a zapper for skyrim --- .../{zap_fallout_task.sh => zap_fallout.sh} | 0 .../fred/scripts/games/zap_skyrim.sh | 12 +++++++++ scripts/files/find_newest_files.sh | 26 +++++++++++++++++++ scripts/files/find_oldest_files.sh | 26 +++++++++++++++++++ 4 files changed, 64 insertions(+) rename scripts/customize/fred/scripts/games/{zap_fallout_task.sh => zap_fallout.sh} (100%) create mode 100644 scripts/customize/fred/scripts/games/zap_skyrim.sh create mode 100755 scripts/files/find_newest_files.sh create mode 100755 scripts/files/find_oldest_files.sh diff --git a/scripts/customize/fred/scripts/games/zap_fallout_task.sh b/scripts/customize/fred/scripts/games/zap_fallout.sh similarity index 100% rename from scripts/customize/fred/scripts/games/zap_fallout_task.sh rename to scripts/customize/fred/scripts/games/zap_fallout.sh diff --git a/scripts/customize/fred/scripts/games/zap_skyrim.sh b/scripts/customize/fred/scripts/games/zap_skyrim.sh new file mode 100644 index 00000000..0fec2617 --- /dev/null +++ b/scripts/customize/fred/scripts/games/zap_skyrim.sh @@ -0,0 +1,12 @@ +#!/bin/bash + +# windows compatible process killer for any stray processes started as +#"fallout" something. + +source $FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh + +procid="$( psa skyrim | tail -n 1 | awk '{ print $1; }' )" + +if [ ! -z "$procid" ]; then + taskkill.exe /f /pid ${procid} +fi diff --git a/scripts/files/find_newest_files.sh b/scripts/files/find_newest_files.sh new file mode 100755 index 00000000..04a1944c --- /dev/null +++ b/scripts/files/find_newest_files.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# find the most recently updated files in a folder. +# made friendlier for dell by avoiding the .clusterConfig directory and for +# netapp by avoiding the .snapshot directory. + +declare -a paths=("${@}") +echo "paths 1 now is: ${paths[@]}" +if [ ${#paths} -eq 0 ]; then + paths[0]='.' +fi +echo "paths 2 now is: ${paths[@]}" + +for pathname in "${paths[@]}"; do + + echo =============== + echo newest on path: $pathname + echo =============== + echo + + find "$pathname" -path "$pathname/.clusterConfig" -prune -o -path "$pathname/.snapshot" -prune -o -type f -print0 | xargs -0 stat --format '%Y :%y %n' | sort -nr | cut -d: -f2- | head -n 20 + + echo; echo + +done + diff --git a/scripts/files/find_oldest_files.sh b/scripts/files/find_oldest_files.sh new file mode 100755 index 00000000..f50e32cd --- /dev/null +++ b/scripts/files/find_oldest_files.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +# find the most antiquated files in a folder. +# made friendlier for dell by avoiding the .clusterConfig directory and for +# netapp by avoiding the .snapshot directory. + +declare -a paths=("${@}") +echo "paths 1 now is: ${paths[@]}" +if [ ${#paths} -eq 0 ]; then + paths[0]='.' +fi +echo "paths 2 now is: ${paths[@]}" + +for pathname in "${paths[@]}"; do + + echo =============== + echo oldest on path: $pathname + echo =============== + echo + + find "$pathname" -path "$pathname/.clusterConfig" -prune -o -path "$pathname/.snapshot" -prune -o -type f -print0 | xargs -0 stat --format '%Y :%y %n' | sort -n | cut -d: -f2- | head -n 20 + + echo; echo + +done + -- 2.34.1