promotion of archival scripts to mainstream
authorFred Hamster <fred@banshee.gruntose.blurgh>
Sun, 12 May 2019 12:46:02 +0000 (08:46 -0400)
committerFred Hamster <fred@banshee.gruntose.blurgh>
Sun, 12 May 2019 12:46:02 +0000 (08:46 -0400)
this generalizes some archive management scripts and gets them out of fred's custom area.

scripts/archival/compare_backup_drive.sh [new file with mode: 0644]
scripts/archival/localz_comparator.sh [new file with mode: 0644]
scripts/archival/raw_synch.sh [new file with mode: 0644]
scripts/customize/fred/scripts/archival/compare_soapbox.sh [deleted file]
scripts/customize/fred/scripts/archival/euphrosyne_comparator.sh [deleted file]
scripts/customize/fred/scripts/archival/localz_comparator.sh [deleted file]
scripts/customize/fred/scripts/archival/raw_synch.sh [deleted file]

diff --git a/scripts/archival/compare_backup_drive.sh b/scripts/archival/compare_backup_drive.sh
new file mode 100644 (file)
index 0000000..711200b
--- /dev/null
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+# compares the soapbox with the real archive to see if any older stuff might be
+# left behind.  if it's got a less than in front, then it's only on the soapbox drive
+# now rather than the pc's hard drive.
+
+source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
+
+function compare_archives_with_target()
+{
+  local target="$1"; shift
+
+  for currdir in $MAJOR_ARCHIVE_SOURCES; do
+    sep
+    echo "comparing '$currdir' with target '$target', where 'less thans' are on the target..."
+    compare_dirs "$target/$(basename $currdir)" "$currdir"
+  done
+}
+
+# decide which drive to compare.
+targets="$1"
+if [ -z "$targets" ]; then
+  targets=($($(which ls) -1 /media/$USERNAME))
+  if [ ${#targets[@]} -gt 1 ]; then
+    echo "
+Please provide a media drive name on the command line, because more than
+one possibility exists.
+"
+  fi
+fi
+
+echo "comparing the media drive '${targets[0]}' against local archives."
+
+compare_archives_with_target "/media/$USERNAME/${targets[0]}"
+
+sep
+
diff --git a/scripts/archival/localz_comparator.sh b/scripts/archival/localz_comparator.sh
new file mode 100644 (file)
index 0000000..32980c4
--- /dev/null
@@ -0,0 +1,6 @@
+#!/bin/bash
+
+source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
+source "$FEISTY_MEOW_SCRIPTS/archival/comparator.sh"
+
+
diff --git a/scripts/archival/raw_synch.sh b/scripts/archival/raw_synch.sh
new file mode 100644 (file)
index 0000000..17c4b9b
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
+
+synch_host="$1"; shift
+if [ -z "$synch_host" ]; then
+  echo This script requires a hostname where we expect to find archives.
+  exit 1
+fi
+
+echo "Updating our local archives from $synch_host: this is very raw mode, without syncthing!" | splitter
+echo
+
+for currdir in basement imaginations musix toaster walrus; do
+  if [ -d /z/$currdir ]; then
+    sep
+    echo "synching $currdir folder from $synch_host..."
+    rsync -avz "$synch_host":/z/$currdir/* /z/$currdir/
+  fi
+done
+
+sep
+
diff --git a/scripts/customize/fred/scripts/archival/compare_soapbox.sh b/scripts/customize/fred/scripts/archival/compare_soapbox.sh
deleted file mode 100644 (file)
index d489373..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-#!/bin/bash
-
-# compares the soapbox with the real archive to see if any older stuff might be
-# left behind.  if it's got a less than in front, then it's only on the soapbox drive
-# now rather than the pc's hard drive.
-
-source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
-
-function compare_archives_with_target()
-{
-  local target="$1"; shift
-
-  for currdir in $MAJOR_ARCHIVE_SOURCES; do
-    sep
-    echo "comparing '$currdir' with target '$target', where 'less thans' are on the target..."
-    compare_dirs "$target/$(basename $currdir)" "$currdir"
-  done
-}
-
-#hmmm: generalize this one also.
-
-compare_archives_with_target /media/fred/soapboxdrive
-
-sep
-
diff --git a/scripts/customize/fred/scripts/archival/euphrosyne_comparator.sh b/scripts/customize/fred/scripts/archival/euphrosyne_comparator.sh
deleted file mode 100644 (file)
index 32980c4..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-
-source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
-source "$FEISTY_MEOW_SCRIPTS/archival/comparator.sh"
-
-
diff --git a/scripts/customize/fred/scripts/archival/localz_comparator.sh b/scripts/customize/fred/scripts/archival/localz_comparator.sh
deleted file mode 100644 (file)
index 32980c4..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-#!/bin/bash
-
-source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
-source "$FEISTY_MEOW_SCRIPTS/archival/comparator.sh"
-
-
diff --git a/scripts/customize/fred/scripts/archival/raw_synch.sh b/scripts/customize/fred/scripts/archival/raw_synch.sh
deleted file mode 100644 (file)
index 17c4b9b..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/bash
-
-source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh"
-
-synch_host="$1"; shift
-if [ -z "$synch_host" ]; then
-  echo This script requires a hostname where we expect to find archives.
-  exit 1
-fi
-
-echo "Updating our local archives from $synch_host: this is very raw mode, without syncthing!" | splitter
-echo
-
-for currdir in basement imaginations musix toaster walrus; do
-  if [ -d /z/$currdir ]; then
-    sep
-    echo "synching $currdir folder from $synch_host..."
-    rsync -avz "$synch_host":/z/$currdir/* /z/$currdir/
-  fi
-done
-
-sep
-