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