From: Chris Koeritz Date: Sat, 13 Nov 2021 19:15:00 +0000 (-0500) Subject: scripts that find newest and oldest files in hier X-Git-Tag: 2.140.134~7 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=d767c155175d1de753856af6d4dc7edde815129d;p=feisty_meow.git scripts that find newest and oldest files in hier also a zapper for skyrim --- diff --git a/scripts/customize/fred/scripts/games/zap_fallout.sh b/scripts/customize/fred/scripts/games/zap_fallout.sh new file mode 100644 index 00000000..21e1ddf5 --- /dev/null +++ b/scripts/customize/fred/scripts/games/zap_fallout.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 fallout | tail -n 1 | awk '{ print $1; }' )" + +if [ ! -z "$procid" ]; then + taskkill.exe /f /pid ${procid} +fi diff --git a/scripts/customize/fred/scripts/games/zap_fallout_task.sh b/scripts/customize/fred/scripts/games/zap_fallout_task.sh deleted file mode 100644 index 21e1ddf5..00000000 --- a/scripts/customize/fred/scripts/games/zap_fallout_task.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/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 fallout | tail -n 1 | awk '{ print $1; }' )" - -if [ ! -z "$procid" ]; then - taskkill.exe /f /pid ${procid} -fi 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 +