fail on NAS not mounted
This commit is contained in:
@@ -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]
|
||||
|
||||
|
||||
@@ -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}"
|
||||
|
||||
Reference in New Issue
Block a user