Updates from previous repo

FAQ/FAQ.mkd, FAQ/Makefile: this version of the FAQ is now out of date
    and probably should be deleted.

InternetArchive/repair_item: script to upload missing shows after tie
    out errors during the normal upload; still under development.

InternetArchive/update_state: script to update show state in the
    'reservations' table in the database. Uses the CMS interface.

Link_Checker/scan_links: under development. Not currently usable.

Miscellaneous/fix_tags: audio metadata manipulation script. Recently
    added to this repo for convenience. Updates for 'experimental::try',
    the official Perl try/catch.

PostgreSQL_Database/add_hosts_to_show, PostgreSQL_Database/hpr_schema_2.pgsql,
    PostgreSQL_Database/nuke_n_pave.sh: an old experimental Pg database
    to take over from the previous MySQL version (from before 2023).
    Kept for reference; never implemented.
This commit is contained in:
Dave Morriss
2024-06-14 16:00:04 +01:00
parent 38abbcdd39
commit 50edeccc88
12 changed files with 1874 additions and 146 deletions

View File

@@ -23,15 +23,15 @@
# BUGS: ---
# NOTES: ---
# AUTHOR: Dave Morriss (djm), Dave.Morriss@gmail.com
# VERSION: 0.0.6
# VERSION: 0.0.7
# CREATED: 2020-01-05 22:42:46
# REVISION: 2024-05-10 12:39:52
# REVISION: 2024-05-17 20:49:47
#
#===============================================================================
#set -o nounset # Treat unset variables as an error
VERSION="0.0.6"
VERSION="0.0.7"
SCRIPT=${0##*/}
# DIR=${0%/*}
@@ -190,8 +190,10 @@ Options:
mode and the actions will be carried out.
-D Run in debug mode where a lot more information is
reported
-l N Control the number of shows that can be uploaded at
once. The range is 1 to $DEFLIMIT.
-l N Control the number of files that can be uploaded
during one run of the script. The range is 1 to
$DEFLIMIT. This can be helpful when there are upload
problems.
Arguments:
item The item in the form 'hpr1234'
@@ -274,6 +276,16 @@ else
fi
_DEBUG "Parsed item: $item"
#
# It's possible that the show upload failed before anything was uploaded, even
# the metadata. It's never been seen, but it seems wise to cater for it.
#
if ! ia metadata "$item" --exists > /dev/null 2>&1; then
coloured 'red' "This item is not apparently on the IA; can't continue"
coloured 'yellow' "Try running the entire upload again from the start"
exit 1
fi
#
# Declarations
#
@@ -392,7 +404,7 @@ else
else
retries=0
printf 'Uploading %s\n' "$file"
coloured 'blue' "Uploading $file"
#
# Run 'cmd'. If it succeeds then write to the log and loop for the
@@ -414,9 +426,12 @@ else
[ "$retries" -eq "$retry_threshold" ] && {
((failures++))
[[ $VERBOSE -eq 1 ]] && \
coloured 'blue' "Retry limit reached; abandoning this file"
continue 2
}
[[ $VERBOSE -eq 1 ]] && coloured 'blue' "Pausing for $sleeptime and retrying"
sleep $sleeptime
done # until eval ...