scripts that find newest and oldest files in hier
authorChris Koeritz <fred@gruntose.com>
Sat, 13 Nov 2021 19:15:00 +0000 (14:15 -0500)
committerChris Koeritz <fred@gruntose.com>
Sat, 13 Nov 2021 19:15:00 +0000 (14:15 -0500)
also a zapper for skyrim

scripts/customize/fred/scripts/games/zap_fallout.sh [new file with mode: 0644]
scripts/customize/fred/scripts/games/zap_fallout_task.sh [deleted file]
scripts/customize/fred/scripts/games/zap_skyrim.sh [new file with mode: 0644]
scripts/files/find_newest_files.sh [new file with mode: 0755]
scripts/files/find_oldest_files.sh [new file with mode: 0755]

diff --git a/scripts/customize/fred/scripts/games/zap_fallout.sh b/scripts/customize/fred/scripts/games/zap_fallout.sh
new file mode 100644 (file)
index 0000000..21e1ddf
--- /dev/null
@@ -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 (file)
index 21e1ddf..0000000
+++ /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 (file)
index 0000000..0fec261
--- /dev/null
@@ -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 (executable)
index 0000000..04a1944
--- /dev/null
@@ -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 (executable)
index 0000000..f50e32c
--- /dev/null
@@ -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
+