fail on NAS not mounted

This commit is contained in:
2026-07-28 09:33:50 -07:00
parent d858d7e40b
commit 9752eef0b0
2 changed files with 6 additions and 5 deletions

View File

@@ -1,14 +1,14 @@
#!/bin/bash
#
# sync-newer-images — For each top-level image in SRC, copy it to DEST
# if it doesn't already exist anywhere under DEST.
# sync-newer-images — For each top-level image or video in SRC, copy it to
# DEST if it doesn't already exist anywhere under DEST.
# Works on Linux and macOS (bash 3.2+ compatible).
usage() {
cat <<'EOF'
Usage: sync-newer-images [options] <destination> <source>
For each top-level image in source, copy it into destination if no
For each top-level image or video in source, copy it into destination if no
file with the same name exists anywhere under destination.
Options:
@@ -59,6 +59,7 @@ for srcfile in "$SRC"/*; do
ext="${srcfile##*.}"
case "$(echo "$ext" | tr '[:upper:]' '[:lower:]')" in
jpg|jpeg|png|gif|heic|webp|bmp|tiff|tif) ;;
mov|mp4|m4v|avi|mkv|3gp) ;;
*) continue ;;
esac
@@ -76,4 +77,4 @@ for srcfile in "$SRC"/*; do
fi
done
echo "Copied ${copied} image(s) from ${SRC} into ${DEST}"
echo "Copied ${copied} image(s)/video(s) from ${SRC} into ${DEST}"