From 9752eef0b0a59c20c53c6e35977abeb8ced2f7d6 Mon Sep 17 00:00:00 2001 From: schmeeve Date: Tue, 28 Jul 2026 09:33:50 -0700 Subject: [PATCH] fail on NAS not mounted --- push-newer-pics | 2 +- sync-newer-images | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/push-newer-pics b/push-newer-pics index e0b23f1..c4eba6d 100755 --- a/push-newer-pics +++ b/push-newer-pics @@ -1,7 +1,7 @@ #!/bin/bash # # push-newer-pics — Wrapper for sync-newer-images with default paths. -# Copies new images from ~/Pictures → ~/mnt/mini.nas/miniShare1/Pictures +# Copies new images/videos from ~/Pictures → ~/mnt/mini.nas/miniShare1/Pictures # # Usage: push-newer-pics [--help] [-u|--update] diff --git a/sync-newer-images b/sync-newer-images index c569388..6b3ffd9 100755 --- a/sync-newer-images +++ b/sync-newer-images @@ -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] -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}"