From 060ecc2f2f2a779298bdd2bb95544cd5c6400b33 Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Fri, 5 Nov 2021 19:55:09 -0400 Subject: [PATCH] new script to find the latest files in a folder also a customized script for fred for backing up his onedrive folder. some better docs too. --- .../fred/scripts/jobby/onedrive_backerer.sh | 16 ++++++++++++++++ scripts/files/find_latest_files.sh | 16 ++++++++++++++++ scripts/security/show_all_cert_chains.sh | 5 +++++ 3 files changed, 37 insertions(+) create mode 100644 scripts/customize/fred/scripts/jobby/onedrive_backerer.sh create mode 100755 scripts/files/find_latest_files.sh diff --git a/scripts/customize/fred/scripts/jobby/onedrive_backerer.sh b/scripts/customize/fred/scripts/jobby/onedrive_backerer.sh new file mode 100644 index 00000000..1adfa9bb --- /dev/null +++ b/scripts/customize/fred/scripts/jobby/onedrive_backerer.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# backs up the uva onedrive folder (which itself is fed from the cloud). + +source "$FEISTY_MEOW_SCRIPTS/core/launch_feisty_meow.sh" + +pushd ~/data +exit_on_error changing to data folder. + +zip -r ~/onedrive_backup_uva_$(date_stringer).zip onedrive-uva-live -x \*.ova -x \*.webarchive +exit_on_error zipping up the uva onedrive folder. + + +popd + + diff --git a/scripts/files/find_latest_files.sh b/scripts/files/find_latest_files.sh new file mode 100755 index 00000000..27959618 --- /dev/null +++ b/scripts/files/find_latest_files.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# find last written files, made friendly for dell by avoiding the .clusterConfig directory. + +for pathname in "${@}"; do + + echo ============== + echo latest on path: $pathname + echo + + find "$pathname" -path "$pathname/.clusterConfig" -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/security/show_all_cert_chains.sh b/scripts/security/show_all_cert_chains.sh index 1fe4125b..f36415a0 100644 --- a/scripts/security/show_all_cert_chains.sh +++ b/scripts/security/show_all_cert_chains.sh @@ -1,5 +1,10 @@ #!/bin/bash +# displays every certificate in a PEM file that has a whole certificate chain. +# this is surprisingly annoying to get anything to output, so we codified it. + +# by chris koeritz + file="$1"; shift if [ -z "$file" -o ! -f "$file" ]; then echo This script requires a PEM-format file name to show the certificates within. -- 2.34.1